forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

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

patchClassBlueprintByGrade.ts19 lines, 748 bytesHistoryRawDownload
1import { client } from "../client";
2import type { BlueprintResult } from "../client";
3
4// `course_ids` is the whole set, not a delta: a course dropped from it is
5// detached from every class at this grade that the blueprint attached it to.
6// Hand-attached courses are never touched.
7export type UpdateBlueprintBody = { course_ids: string[] };
8
9// A 409 means the blueprint changed since it was read — there is no version to
10// echo back, so re-read it and let the user resubmit from the fresh list.
11export function patchClassBlueprintByGrade(
12 grade: string,
13 body: UpdateBlueprintBody,
14): Promise<BlueprintResult> {
15 return client<BlueprintResult>(`/classes/blueprints/${encodeURIComponent(grade)}`, {
16 method: "PATCH",
17 body,
18 });
19}