forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

0 watching0 forksTypeScript5.5 MiB0069847Burak Boduroğlu2 months ago552 commits

patchSettings.ts23 lines, 776 bytesHistoryRawDownload
1import { client } from "../client";
2import { setCachedSettings } from "./getSettings";
3import type { ExamKindSetting, GradeBand, MealSlot, SchoolSettings } from "../client";
4
5export type PatchSettingsBody = {
6 exam_kinds?: ExamKindSetting[];
7 attendance_statuses?: string[];
8 grade_bands?: GradeBand[];
9 max_file_bytes?: number;
10 chatbot_history_turns?: number;
11 max_chatbot_threads?: number;
12 max_chatbot_message_len?: number;
13 meal_slots?: MealSlot[];
14 dietary_tags?: string[];
15 meal_cancel_cutoff_minutes?: number | null;
16};
17
18export function patchSettings(body: PatchSettingsBody): Promise<SchoolSettings> {
19 return client<SchoolSettings>("/settings", { method: "PATCH", body }).then((settings) => {
20 setCachedSettings(settings);
21 return settings;
22 });
23}