diff --git a/client/src/app/core/repositories/agenda/item-repository.service.ts b/client/src/app/core/repositories/agenda/item-repository.service.ts index 2671f7ca9..155557ed7 100644 --- a/client/src/app/core/repositories/agenda/item-repository.service.ts +++ b/client/src/app/core/repositories/agenda/item-repository.service.ts @@ -139,6 +139,27 @@ export class ItemRepositoryService extends BaseHasContentObjectRepository< await this.httpService.delete(restUrl); } + /** + * TODO: Copied from BaseRepository and added the cloned model to write back the + * item_number correctly. This must be reversed with #4738 (indroduced with #4639) + * + * Saves the (full) update to an existing model. So called "update"-function + * Provides a default procedure, but can be overwritten if required + * + * @param update the update that should be created + * @param viewModel the view model that the update is based on + */ + public async update(update: Partial, viewModel: ViewItem): Promise { + const sendUpdate = new this.baseModelCtor(); + sendUpdate.patchValues(viewModel.getModel()); + sendUpdate.patchValues(update); + + const clone = JSON.parse(JSON.stringify(sendUpdate)); + clone.item_number = clone._itemNumber; + const restPath = `/rest/${sendUpdate.collectionString}/${sendUpdate.id}/`; + return await this.httpService.put(restPath, clone); + } + /** * Get agenda visibility from the config * 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 06f2ac466..d56dcf083 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 @@ -440,7 +440,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.user.id === u.id))); + this.filteredUsers.next(users.filter(u => !this.speakers.some(speaker => speaker.userId === u.id))); } } }