diff --git a/src/client/src/app/components/events/event-timeslot/event-timeslot.component.ts b/src/client/src/app/components/events/event-timeslot/event-timeslot.component.ts index a26e1e4..c82af66 100644 --- a/src/client/src/app/components/events/event-timeslot/event-timeslot.component.ts +++ b/src/client/src/app/components/events/event-timeslot/event-timeslot.component.ts @@ -190,7 +190,7 @@ export class EventTimeslotComponent { } } - protected async addPlayer(player: User) { + protected async addPlayer(userId: string) { const eventId = this.eventId(); const timeslotId = this.timeslotId(); @@ -198,7 +198,7 @@ export class EventTimeslotComponent { const response = await this._eventService.patchPlayerEventRegistrations({ eventId, - body: { userId: player.id, timeslotId: timeslotId, isRegistered: true }, + body: { userId: userId, timeslotId: timeslotId, isRegistered: true }, }); if (response.ok) { this._messageService.add({ @@ -206,6 +206,12 @@ export class EventTimeslotComponent { summary: this.translations.events_timeslot_playerAdded(), life: 2000, }); + } else { + this._messageService.add({ + severity: 'error', + summary: this.translations.events_timeslot_error_playerAdded(), + life: 2000, + }); } }