forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

0 watching0 forksTypeScript5.5 MiB078b459Burak Boduroğlu2 months ago671 commits

postClass.ts13 lines, 671 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.
6export 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.
11export function postClass(body: CreateClassBody): Promise<CreateClassResponse> {
12 return client<CreateClassResponse>("/classes", { method: "POST", body });
13}