hezarfen_frontend
Clone
https://git.tahinli.com/archive/hezarfen_frontend.git
0 watching0 forksTypeScript5.5 MiB5fcd955Burak Boduroğlu2 months ago730 commits
| 1 | import { client } from "../client"; |
| 2 | import type { Page, PageParams } from "../client"; |
| 3 | import type { PersonRef } from "../client"; |
| 4 | |
| 5 | export async function getParentStudents(id: string, params?: PageParams): Promise<Page<PersonRef>> { |
| 6 | const searchParams = new URLSearchParams(); |
| 7 | if (params?.limit !== undefined) searchParams.set("limit", params.limit.toString()); |
| 8 | if (params?.offset !== undefined) searchParams.set("offset", params.offset.toString()); |
| 9 | |
| 10 | const query = searchParams.toString(); |
| 11 | const url = query ? `/users/${id}/students?${query}` : `/users/${id}/students`; |
| 12 | |
| 13 | return client(url); |
| 14 | } |