From 7f73fbf2b34a64ca333de92a8264ffe67d5fdb18 Mon Sep 17 00:00:00 2001 From: SKairinos Date: Wed, 24 Jul 2024 12:59:31 +0000 Subject: [PATCH] fix list filters --- src/api/endpoints/klass.ts | 4 ++-- src/api/endpoints/user.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/api/endpoints/klass.ts b/src/api/endpoints/klass.ts index 9262730..0f37c94 100644 --- a/src/api/endpoints/klass.ts +++ b/src/api/endpoints/klass.ts @@ -8,7 +8,7 @@ import { type RetrieveArg, type RetrieveResult, } from "../../utils/api" -import type { Class } from "../models" +import type { Class, Teacher } from "../models" import { type TagTypes } from "../tagTypes" import urls from "../urls" @@ -32,7 +32,7 @@ export type ListClassesResult = ListResult< | "school" | "teacher" > -export type ListClassesArg = ListArg +export type ListClassesArg = ListArg<{ teacher: Teacher["id"] }> export default function getReadClassEndpoints( build: EndpointBuilder, diff --git a/src/api/endpoints/user.ts b/src/api/endpoints/user.ts index fd70554..79b45cc 100644 --- a/src/api/endpoints/user.ts +++ b/src/api/endpoints/user.ts @@ -8,7 +8,7 @@ import { type RetrieveArg, type RetrieveResult, } from "../../utils/api" -import type { User } from "../models" +import type { Class, User } from "../models" import { type TagTypes } from "../tagTypes" import urls from "../urls" @@ -38,7 +38,7 @@ export type ListUsersResult = ListResult< | "student" | "teacher" > -export type ListUsersArg = ListArg<{ students_in_class: string }> +export type ListUsersArg = ListArg<{ students_in_class: Class["id"] }> export default function getReadUserEndpoints( build: EndpointBuilder,