Create new projectors with clos reference
New projectors will be created on a reference to the current list of of speakers
This commit is contained in:
parent
fe71322199
commit
99c3afb417
@ -135,4 +135,11 @@ export class ProjectorRepositoryService extends BaseRepository<ViewProjector, Pr
|
||||
public async setReferenceProjector(projector_id: number): Promise<void> {
|
||||
await this.http.post<void>(`/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;
|
||||
}
|
||||
}
|
||||
|
@ -113,7 +113,8 @@ export class ProjectorListComponent extends BaseViewComponent implements OnInit,
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
if (result) {
|
||||
const projectorToCreate: Partial<Projector> = {
|
||||
name: this.createForm.value.name
|
||||
name: this.createForm.value.name,
|
||||
reference_projector_id: this.repo.getReferenceProjectorId()
|
||||
};
|
||||
|
||||
this.repo.create(projectorToCreate).then(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user