hezarfen_frontend
Clone
https://git.tahinli.com/Hezarfen/hezarfen_frontend.git
0 watching0 forksTypeScript5.5 MiB5fcd955Burak Boduroğlu2 months ago730 commits
| 1 | import { client } from "../client"; |
| 2 | import { normalizePage, pageQuery, type Page, type PageParams } from "../client"; |
| 3 | import type { ClassCourse } from "../client"; |
| 4 | |
| 5 | /** |
| 6 | * The instances a class carries — each a catalog course as this section |
| 7 | * teaches it, with its hours, karne policy and teachers. Requires teacher+. |
| 8 | */ |
| 9 | export async function getClassInstances( |
| 10 | classId: string, |
| 11 | params?: PageParams, |
| 12 | signal?: AbortSignal, |
| 13 | ): Promise<Page<ClassCourse>> { |
| 14 | const data = await client<unknown>(`/classes/${classId}/instances${pageQuery(params)}`, { signal }); |
| 15 | return normalizePage<ClassCourse>(data); |
| 16 | } |