Merge pull request #4897 from FinnStutzenstein/fixLOSUsers

Fix user loading in ViewSpeaker
This commit is contained in:
Finn Stutzenstein 2019-08-05 12:37:23 +02:00 committed by GitHub
commit 32bec58333
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -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);
}
}

View File

@ -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)));
}
}
}

View File

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