Fix user loading in ViewSpeaker

This commit is contained in:
FinnStutzenstein 2019-08-05 12:08:43 +02:00
parent 6bd8da29db
commit bdb206624b
3 changed files with 5 additions and 5 deletions

View File

@ -94,13 +94,13 @@ export abstract class BaseHasContentObjectRepository<
return true; return true;
} else { } else {
console.warn(`The object is not an ${relation.VForeignVerbose}:` + foreignModel); console.warn(`The object is not an ${relation.VForeignVerbose}:` + foreignModel);
return false;
} }
// TODO: set reverse // TODO: set reverse
} }
return false;
} else { } else {
super.updateSingleDependency(ownViewModel, relation, collection, changedId); return super.updateSingleDependency(ownViewModel, relation, collection, changedId);
} }
} }

View File

@ -359,7 +359,7 @@ export class ListOfSpeakersComponent extends BaseViewComponent implements OnInit
* @returns whether or not the current operator is in the list * @returns whether or not the current operator is in the list
*/ */
public isOpInList(): boolean { 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) { if (!this.speakers || !this.speakers.length) {
this.filteredUsers.next(users); this.filteredUsers.next(users);
} else { } 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)));
} }
} }
} }

View File

@ -30,7 +30,7 @@ export class ViewSpeaker extends BaseViewModel<Speaker> {
return this.speaker.id; return this.speaker.id;
} }
public get userId(): number { public get user_id(): number {
return this.speaker.user_id; return this.speaker.user_id;
} }