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 { ClassCourse } from "../client"; |
| 3 | |
| 4 | export type AttachCourseBody = { course_id: string }; |
| 5 | |
| 6 | /** |
| 7 | * Attaching a catalog course to a şube is what **mints the instance** — the |
| 8 | * class×course row every exam, session and roster keys on. The class's whole |
| 9 | * roster is enrolled in one go; students already enrolled by hand keep their |
| 10 | * own rows. Needs teacher+ and catalog rights on the course; 409 on a repeat. |
| 11 | */ |
| 12 | export function postClassInstance(classId: string, body: AttachCourseBody): Promise<ClassCourse> { |
| 13 | return client<ClassCourse>(`/classes/${classId}/instances`, { method: "POST", body }); |
| 14 | } |