forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

0 watching0 forksTypeScript5.5 MiB7122d71Burak Boduroğlu4 months ago419 commits

patchCourseById.ts15 lines, 492 bytesHistoryRawDownload
1import { client } from "../client";
2import type { Course, CourseKind } from "../client";
3
4/** Omitted fields keep their value. Only `term_id`/`capacity` clear on explicit null. */
5export type PatchCourseBody = {
6 title?: string;
7 description?: string;
8 kind?: CourseKind;
9 term_id?: string | null;
10 capacity?: number | null;
11};
12
13export function patchCourseById(id: string, body: PatchCourseBody): Promise<Course> {
14 return client<Course>(`/courses/${id}`, { method: "PATCH", body });
15}