forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

0 watching0 forksTypeScript5.5 MiB5fcd955Burak Boduroğlu2 months ago730 commits

getClassInstances.ts16 lines, 612 bytesHistoryRawDownload
1import { client } from "../client";
2import { normalizePage, pageQuery, type Page, type PageParams } from "../client";
3import 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 */
9export 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}