Import des sources angular à partir de 'headup_app'

This commit is contained in:
Rampeur
2025-08-11 23:26:29 +02:00
parent 7dcb426ef5
commit 0a6cbc0c00
335 changed files with 64362 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
import { Injectable } from '@angular/core';
import { HttpClient, HttpParams } from '@angular/common/http';
import { Observable } from 'rxjs';
//import { environment } from 'src/environments/environment';
@Injectable({ providedIn: 'root' })
export class ApiService {
constructor(
private http: HttpClient
) { }
/*private formatErrors(error: any) {
return throwError(error.error);
}*/
get(path: string, params: HttpParams = new HttpParams()): Observable<any> {
return this.http.get(`${path}`, { params });
}
put(path: string, body: NonNullable<unknown> = {}): Observable<any> {
return this.http.put(`${path}`, JSON.stringify(body));
}
post(path: string, body: NonNullable<unknown> = {}): Observable<any> {
return this.http.post(`${path}`, JSON.stringify(body));
}
delete(path: string): Observable<any> {
return this.http.delete(`${path}`);
}
}