forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

0 watching0 forksTypeScript5.5 MiBdcf123aBurak Boduroğlu2 months ago674 commits

postClassInstance.ts14 lines, 652 bytesHistoryRawDownload
1import { client } from "../client";
2import type { ClassCourse } from "../client";
3
4export 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 */
12export function postClassInstance(classId: string, body: AttachCourseBody): Promise<ClassCourse> {
13 return client<ClassCourse>(`/classes/${classId}/instances`, { method: "POST", body });
14}