Logging und sowas
This commit is contained in:
@@ -92,6 +92,24 @@ export class ApiService {
|
||||
})
|
||||
}
|
||||
|
||||
updateSystem(cylinder: any): Promise<boolean> {
|
||||
return new Promise<boolean>(resolve => {
|
||||
this.http.put('api/system', cylinder).pipe(
|
||||
this.toast.observe({
|
||||
loading: `Schließanlage ${cylinder} wird gespeichert...`,
|
||||
success: `Schließanlage ${cylinder.name} gespeichert.`,
|
||||
error: 'Es ist ein Fehler aufgetreten'
|
||||
})
|
||||
).subscribe({
|
||||
next: () => resolve(true),
|
||||
error: () => resolve(false),
|
||||
complete: () => {
|
||||
this.refreshCylinders()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
createKey(key: any) {
|
||||
return this.http.post<IKey>('api/key', key);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user