Skip to content

Commit

Permalink
refactor: return group IDs in sport client
Browse files Browse the repository at this point in the history
  • Loading branch information
evermake committed Apr 14, 2024
1 parent 3f7e611 commit a0dbc43
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backend/src/services/sport/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export class SportClient extends ApiClient {
title: t.title,
startsAt: t.start,
endsAt: t.end,
groupId: t.extendedProps.group_id,
checkedIn: t.extendedProps.checked_in ?? false,
checkInAvailable: t.extendedProps.can_check_in ?? false,
}))
Expand All @@ -119,6 +120,7 @@ export class SportClient extends ApiClient {
checkedIn: raw.checked_in ?? false,
checkInAvailable: raw.can_check_in ?? false,
location: raw.training.place,
groupId: raw.training.group.id,
teachers: raw.training.group.teachers.map(t => ({
id: t.id,
firstName: t.first_name,
Expand Down
2 changes: 2 additions & 0 deletions backend/src/services/sport/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export type TrainingInfo = {
title: string
startsAt: Date
endsAt: Date
groupId: number
checkedIn: boolean
checkInAvailable: boolean
}
Expand All @@ -23,6 +24,7 @@ export type TrainingDetailed = {
accredited: boolean
checkedIn: boolean
checkInAvailable: boolean
groupId: number
location: string
teachers: {
id: number
Expand Down

0 comments on commit a0dbc43

Please sign in to comment.