hezarfen_frontend
Clone
https://git.tahinli.com/archive/hezarfen_frontend.git
0 watching0 forksTypeScript5.5 MiB7122d71Burak Boduroğlu4 months ago419 commits
| 1 | import { client } from "../client"; |
| 2 | import { setCachedSettings } from "./getSettings"; |
| 3 | import type { ExamKindSetting, GradeBand, MealSlot, SchoolSettings } from "../client"; |
| 4 | |
| 5 | export 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 | |
| 18 | export function patchSettings(body: PatchSettingsBody): Promise<SchoolSettings> { |
| 19 | return client<SchoolSettings>("/settings", { method: "PATCH", body }).then((settings) => { |
| 20 | setCachedSettings(settings); |
| 21 | return settings; |
| 22 | }); |
| 23 | } |