diff --git a/client/src/app/core/repositories/projector/projector-repository.service.ts b/client/src/app/core/repositories/projector/projector-repository.service.ts index c0f718110..d2ef0ae99 100644 --- a/client/src/app/core/repositories/projector/projector-repository.service.ts +++ b/client/src/app/core/repositories/projector/projector-repository.service.ts @@ -135,4 +135,11 @@ export class ProjectorRepositoryService extends BaseRepository { await this.http.post(`/rest/core/projector/${projector_id}/set_reference_projector/`); } + + /** + * return the id of the current reference projector + */ + public getReferenceProjectorId(): number { + return this.getViewModelList().find(projector => projector.isReferenceProjector).id; + } } diff --git a/client/src/app/site/projector/components/projector-list/projector-list.component.ts b/client/src/app/site/projector/components/projector-list/projector-list.component.ts index d78c3d2c8..99718d932 100644 --- a/client/src/app/site/projector/components/projector-list/projector-list.component.ts +++ b/client/src/app/site/projector/components/projector-list/projector-list.component.ts @@ -113,7 +113,8 @@ export class ProjectorListComponent extends BaseViewComponent implements OnInit, dialogRef.afterClosed().subscribe(result => { if (result) { const projectorToCreate: Partial = { - name: this.createForm.value.name + name: this.createForm.value.name, + reference_projector_id: this.repo.getReferenceProjectorId() }; this.repo.create(projectorToCreate).then(() => {