forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

0 watching0 forksTypeScript5.5 MiBd962efeBurak Boduroğlu4 months ago146 commits

patchSettings.ts17 lines, 561 bytesHistoryRawDownload
1import { client } from "./client";
2import { setCachedSettings } from "./getSettings";
3import type { ExamKindSetting, GradeBand, SchoolSettings } from "./types";
4
5export type PatchSettingsBody = {
6 exam_kinds?: ExamKindSetting[];
7 attendance_statuses?: string[];
8 grade_bands?: GradeBand[];
9 max_file_bytes?: number;
10};
11
12export function patchSettings(body: PatchSettingsBody): Promise<SchoolSettings> {
13 return client<SchoolSettings>("/settings", { method: "PATCH", body }).then((settings) => {
14 setCachedSettings(settings);
15 return settings;
16 });
17}