This commit is contained in:
Bastian Wagner
2024-10-25 12:32:26 +02:00
parent d4f1fbbf39
commit b4e264eda9
40 changed files with 538 additions and 66 deletions

View File

@@ -3,6 +3,7 @@ import { inject, Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { IUser } from '../model/interface/user.interface';
import { IKey } from '../model/interface/key.interface';
import { ICylinder } from '../model/interface/cylinder.interface';
@Injectable({
providedIn: 'root'
@@ -37,8 +38,12 @@ export class ApiService {
return this.http.post<IKey>('api/key', key);
}
postKeySystem(keySystem: any) {
return this.http.post('api/key/system', keySystem);
createSystem(keySystem: any) {
return this.http.post('api/system', keySystem);
}
getSystems(): Observable<any[]> {
return this.http.get<any[]>('api/system');
}
handoverKey(data: any) {
@@ -69,7 +74,11 @@ export class ApiService {
return this.http.put(`api/key/${id}/restore`, null);
}
getCylinders(): Observable<any[]> {
return this.http.get<any[]>('api/cylinder');
getCylinders(): Observable<ICylinder[]> {
return this.http.get<ICylinder[]>('api/cylinder');
}
deleteCylinder(cylinder: ICylinder): Observable<any> {
return this.http.delete(`api/cylinder/${cylinder.id}`)
}
}