Merge pull request #5273 from tsiegleauq/new-projector-reference
Create new projectors with clos reference
This commit is contained in:
commit
7d86f62e2d
@ -135,4 +135,11 @@ export class ProjectorRepositoryService extends BaseRepository<ViewProjector, Pr
|
|||||||
public async setReferenceProjector(projector_id: number): Promise<void> {
|
public async setReferenceProjector(projector_id: number): Promise<void> {
|
||||||
await this.http.post<void>(`/rest/core/projector/${projector_id}/set_reference_projector/`);
|
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 => {
|
dialogRef.afterClosed().subscribe(result => {
|
||||||
if (result) {
|
if (result) {
|
||||||
const projectorToCreate: Partial<Projector> = {
|
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(() => {
|
this.repo.create(projectorToCreate).then(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user