forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

0 watching0 forksTypeScript5.5 MiBdcf123aBurak Boduroğlu2 months ago674 commits

patchSettings.ts32 lines, 1.2 KiBHistoryRawDownload
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 /** What an absence may be excused as (raporlu/izinli/…). */
17 excuse_kinds?: string[];
18 /** The branş vocabulary a profile's `branch` may name. */
19 branches?: string[];
20 /** Per-dönem day limits; null clears the limit. */
21 max_excused_absent_days?: number | null;
22 max_unexcused_absent_days?: number | null;
23 /** IANA timezone the devamsızlık days are bucketed in; null = deployment default. */
24 timezone?: string | null;
25};
26
27export function patchSettings(body: PatchSettingsBody): Promise<SchoolSettings> {
28 return client<SchoolSettings>("/settings", { method: "PATCH", body }).then((settings) => {
29 setCachedSettings(settings);
30 return settings;
31 });
32}