Api umgebaut
This commit is contained in:
@@ -44,6 +44,12 @@ export class CreateKeyComponent {
|
||||
}
|
||||
|
||||
async doSetup() {
|
||||
this.api.cylinders.subscribe({
|
||||
next: data => {
|
||||
this.cylinders = data;
|
||||
this.createForm.controls.cylinder.patchValue(null);
|
||||
}
|
||||
})
|
||||
await this.loadCylinders();
|
||||
|
||||
this.filteredCylinders = this.createForm.controls.cylinder.valueChanges.pipe(
|
||||
@@ -63,15 +69,7 @@ export class CreateKeyComponent {
|
||||
}
|
||||
|
||||
loadCylinders() {
|
||||
return new Promise(resolve => {
|
||||
this.api.getCylinders().subscribe({
|
||||
next: n => {
|
||||
this.cylinders = n;
|
||||
this.createForm.controls.cylinder.patchValue(null);
|
||||
resolve(null)
|
||||
}
|
||||
});
|
||||
})
|
||||
return this.api.refreshCylinders();
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user