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 { 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. |
| 7 | export 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. |
| 11 | export 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 | } |