From bdb206624bb6675654c413812c5b2eb6889eaf40 Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Mon, 5 Aug 2019 12:08:43 +0200 Subject: [PATCH] Fix user loading in ViewSpeaker --- .../core/repositories/base-has-content-object-repository.ts | 4 ++-- .../components/list-of-speakers/list-of-speakers.component.ts | 4 ++-- client/src/app/site/agenda/models/view-speaker.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/src/app/core/repositories/base-has-content-object-repository.ts b/client/src/app/core/repositories/base-has-content-object-repository.ts index a62e810bf..e1b36e77e 100644 --- a/client/src/app/core/repositories/base-has-content-object-repository.ts +++ b/client/src/app/core/repositories/base-has-content-object-repository.ts @@ -94,13 +94,13 @@ export abstract class BaseHasContentObjectRepository< return true; } else { console.warn(`The object is not an ${relation.VForeignVerbose}:` + foreignModel); - return false; } // TODO: set reverse } + return false; } else { - super.updateSingleDependency(ownViewModel, relation, collection, changedId); + return super.updateSingleDependency(ownViewModel, relation, collection, changedId); } } diff --git a/client/src/app/site/agenda/components/list-of-speakers/list-of-speakers.component.ts b/client/src/app/site/agenda/components/list-of-speakers/list-of-speakers.component.ts index 4e3744d87..9d89ff605 100644 --- a/client/src/app/site/agenda/components/list-of-speakers/list-of-speakers.component.ts +++ b/client/src/app/site/agenda/components/list-of-speakers/list-of-speakers.component.ts @@ -359,7 +359,7 @@ export class ListOfSpeakersComponent extends BaseViewComponent implements OnInit * @returns whether or not the current operator is in the list */ public isOpInList(): boolean { - return this.speakers.some(speaker => speaker.userId === this.operator.user.id); + return this.speakers.some(speaker => speaker.user_id === this.operator.user.id); } /** @@ -444,7 +444,7 @@ export class ListOfSpeakersComponent extends BaseViewComponent implements OnInit if (!this.speakers || !this.speakers.length) { this.filteredUsers.next(users); } else { - this.filteredUsers.next(users.filter(u => !this.speakers.some(speaker => speaker.userId === u.id))); + this.filteredUsers.next(users.filter(u => !this.speakers.some(speaker => speaker.user_id === u.id))); } } } diff --git a/client/src/app/site/agenda/models/view-speaker.ts b/client/src/app/site/agenda/models/view-speaker.ts index c004371a8..ec785ff0e 100644 --- a/client/src/app/site/agenda/models/view-speaker.ts +++ b/client/src/app/site/agenda/models/view-speaker.ts @@ -30,7 +30,7 @@ export class ViewSpeaker extends BaseViewModel { return this.speaker.id; } - public get userId(): number { + public get user_id(): number { return this.speaker.user_id; }