forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

0 watching0 forksTypeScript5.5 MiB5fcd955Burak Boduroğlu2 months ago730 commits

patchClassById.ts16 lines, 609 bytesHistoryRawDownload
1import { client } from "../client";
2import type { ClassGroup } from "../client";
3
4// Omit a field to keep it; send null on year/teacher_id to clear/unlink it. The
5// grade is required on every class, so `grade_level` can be reset, never cleared.
6export type UpdateClassBody = {
7 name?: string;
8 grade_level?: number;
9 /** The academic year (`getAcademicYears`) the şube sits in. */
10 year?: string | null;
11 teacher_id?: string | null;
12};
13
14export function patchClassById(id: string, body: UpdateClassBody): Promise<ClassGroup> {
15 return client<ClassGroup>(`/classes/${id}`, { method: "PATCH", body });
16}