39 lines
1.0 KiB
TypeScript
39 lines
1.0 KiB
TypeScript
import { Injectable } from '@angular/core';
|
|
import { HttpClient } from '@angular/common/http';
|
|
import { environment } from '../../../environments/environment.prod';
|
|
import { MaintenanceResult } from '../../shared/models/maintenanceResult.model';
|
|
|
|
@Injectable({
|
|
providedIn: 'root',
|
|
})
|
|
export class MaintenanceService {
|
|
private backend_apiUrl = environment.API_URL;
|
|
private apiAction = 'maintenance';
|
|
|
|
constructor(private http: HttpClient) {}
|
|
|
|
getOrphanFiles() {
|
|
return this.http.get<MaintenanceResult>(
|
|
`${this.backend_apiUrl}/${this.apiAction}/orphan-files`
|
|
);
|
|
}
|
|
|
|
getMissingFiles() {
|
|
return this.http.get<MaintenanceResult>(
|
|
`${this.backend_apiUrl}/${this.apiAction}/missing-files`
|
|
);
|
|
}
|
|
|
|
deleteOrphanFiles() {
|
|
return this.http.delete<MaintenanceResult>(
|
|
`${this.backend_apiUrl}/${this.apiAction}/orphan-files`
|
|
);
|
|
}
|
|
|
|
deleteMissingFiles() {
|
|
return this.http.delete<MaintenanceResult>(
|
|
`${this.backend_apiUrl}/${this.apiAction}/missing-files`
|
|
);
|
|
}
|
|
}
|