import { Injectable } from '@angular/core'; import { HttpClient, HttpParams } from '@angular/common/http'; import { environment } from '../../../environments/environment'; @Injectable({ providedIn: 'root', }) export class ServiceManagementService { constructor(private http: HttpClient) { } getAllServices(page: number = 0, size: number = 10) { let params = new HttpParams() .set('page', page.toString()) .set('size', size.toString()); return this.http.get(environment.apiUrl + "/services/manage", { params }); } createOrUpdateService(service: any) { return this.http.post(environment.apiUrl + "/services/manage", service); } deleteService(service: any) { return this.http.delete(environment.apiUrl + "/services/manage", { body: service }); } }