hezarfen_frontend
Clone
https://git.tahinli.com/archive/hezarfen_frontend.git
0 watching0 forksTypeScript5.5 MiBdcf123aBurak Boduroğlu2 months ago674 commits
| 1 | import { client } from "../client"; |
| 2 | import 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 | export type CreateClassBody = { name: string; grade?: string; year?: string; teacher_id?: string }; |
| 7 | |
| 8 | // The 201 is a create envelope, not the bare class: its `class` is what the |
| 9 | // route navigates to, and its `skipped` is the blueprint fallout the caller |
| 10 | // has to report. |
| 11 | export function postClass(body: CreateClassBody): Promise<CreateClassResponse> { |
| 12 | return client<CreateClassResponse>("/classes", { method: "POST", body }); |
| 13 | } |