e58bcbef57
- Added ConsumerStore and PosStore to manage state and data fetching for consumers and POS entities. - Implemented breadcrumb functionality in both stores to enhance navigation. - Created views for consumer accounts, business activities, complexes, and poses with respective components. - Developed single view components for detailed display and editing of consumer and POS data. - Introduced charge account management components in the super admin module, including forms and lists for charge transactions. - Established API routes and services for handling charge account transactions.
25 lines
843 B
TypeScript
25 lines
843 B
TypeScript
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<ILicenseResponse> {
|
|
return this.http.post<ILicenseRawResponse>(this.apiRoutes.list(consumerId), data);
|
|
}
|
|
|
|
update(
|
|
consumerId: string,
|
|
licenseId: string,
|
|
data: ILicenseRequest,
|
|
): Observable<ILicenseResponse> {
|
|
return this.http.patch<ILicenseRawResponse>(this.apiRoutes.single(consumerId, licenseId), data);
|
|
}
|
|
}
|