import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { CONSUMER_LICENSES_API_ROUTES } from '../constants'; import { ILicenseRawResponse, ILicenseRequest, ILicenseResponse } from '../models'; @Injectable({ providedIn: 'root' }) export class LicensesService { constructor(private http: HttpClient) {} private apiRoutes = CONSUMER_LICENSES_API_ROUTES; create(consumerId: string, data: ILicenseRequest): Observable { return this.http.post(this.apiRoutes.list(consumerId), data); } update( consumerId: string, licenseId: string, data: ILicenseRequest, ): Observable { return this.http.patch(this.apiRoutes.single(consumerId, licenseId), data); } }