Skip to content

Commit

Permalink
nested user object
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed Aug 27, 2024
1 parent 4ce4ff9 commit fdb859d
Showing 1 changed file with 29 additions and 3 deletions.
32 changes: 29 additions & 3 deletions src/api/endpoints/klass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
type RetrieveArg,
type RetrieveResult,
} from "../../utils/api"
import type { Class, Teacher, SchoolTeacher } from "../models"
import type { Class, Teacher, SchoolTeacher, User } from "../models"
import { type TagTypes } from "../tagTypes"
import urls from "../urls"

Expand All @@ -17,13 +17,39 @@ export const CLASS_TAG: TagTypes = "Class"
export type RetrieveClassResult = RetrieveResult<
Class,
"name" | "read_classmates_data" | "receive_requests_until" | "school"
> & { teacher: SchoolTeacher }
> & {
teacher: SchoolTeacher & {
user: Pick<
User,
| "id"
| "first_name"
| "last_name"
| "email"
| "is_active"
| "date_joined"
| "requesting_to_join_class"
>
}
}
export type RetrieveClassArg = RetrieveArg<Class>

export type ListClassesResult = ListResult<
Class,
"name" | "read_classmates_data" | "receive_requests_until" | "school",
{ teacher: SchoolTeacher }
{
teacher: SchoolTeacher & {
user: Pick<
User,
| "id"
| "first_name"
| "last_name"
| "email"
| "is_active"
| "date_joined"
| "requesting_to_join_class"
>
}
}
>
export type ListClassesArg = ListArg<{ teacher: Teacher["id"] }>

Expand Down

0 comments on commit fdb859d

Please sign in to comment.