forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

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

postClass.ts14 lines, 756 bytesHistoryRawDownload
1import { client } from "../client";
2import type { CreateClassResponse } from "../client";
3
4// `year` is the academic year (`getAcademicYears`) — what binds the şube to a
5// karne and to the rollover. A şube with no year takes no exam.
6// `grade_level` is the rung on the grade ladder, 0 (anaokulu) .. 12; required.
7export type CreateClassBody = { name: string; grade_level: number; year?: string; teacher_id?: string };
8
9// The 201 is a create envelope, not the bare class: its `class` is what the
10// route navigates to, and its `skipped` is the blueprint fallout the caller
11// has to report.
12export function postClass(body: CreateClassBody): Promise<CreateClassResponse> {
13 return client<CreateClassResponse>("/classes", { method: "POST", body });
14}