24 lines
695 B
TypeScript
24 lines
695 B
TypeScript
import {Injectable} from '@angular/core';
|
|
import {HttpClient} from '@angular/common/http';
|
|
import {environment} from '@environments/environment';
|
|
import {Observable} from "rxjs";
|
|
|
|
@Injectable({providedIn: 'root'})
|
|
export class RegistriesService {
|
|
constructor(private http: HttpClient) {
|
|
}
|
|
|
|
list(params?: {}): Observable<any> {
|
|
return this.http.get(`${environment.apiUrl}/api/registries`, {params: params});
|
|
}
|
|
|
|
show(id: string, params?: {}): Observable<any> {
|
|
return this.http.get<any>(`${environment.apiUrl}/api/registries/${id}`, {params: params});
|
|
}
|
|
|
|
delete(id: string): Observable<any> {
|
|
return this.http.delete(`${environment.apiUrl}/api/registries/${id}`);
|
|
}
|
|
|
|
}
|