add endpoint configuration for city, currency, language, and timezone

This commit is contained in:
Gagan7900
2026-07-15 20:19:46 +05:30
parent 095aed204c
commit be86ab3564
72 changed files with 7874 additions and 471 deletions
@@ -1,8 +1,14 @@
import { HttpClient } from "@angular/common/http";
import { HttpClient, HttpParams } from "@angular/common/http";
import { Injectable, inject } from "@angular/core";
import { COUNTRY_ENDPOINTS } from "../../../core/end-points/country/country.endpoints";
import { Observable } from "rxjs";
import { DataTableQuery, DataTableResult } from "../../../shared/components/data-table/data-table.types";
import {
CountryDto,
CountryLookupDto,
CreateCountryRequest,
UpdateCountryRequest
} from "../../models/country/country.model";
@Injectable({
providedIn: 'root'
@@ -11,7 +17,27 @@ export class CountryService {
private readonly http = inject(HttpClient);
getCountryDataTable(query: DataTableQuery): Observable<DataTableResult<any>> {
return this.http.post<DataTableResult<any>>(`${COUNTRY_ENDPOINTS.dataTable}`, query);
getCountryDataTable(query: DataTableQuery): Observable<DataTableResult<CountryDto>> {
return this.http.post<DataTableResult<CountryDto>>(`${COUNTRY_ENDPOINTS.dataTable}`, query);
}
}
createCountry(request: CreateCountryRequest): Observable<CountryDto> {
return this.http.post<CountryDto>(COUNTRY_ENDPOINTS.create, request);
}
updateCountry(id: string, request: UpdateCountryRequest): Observable<CountryDto> {
return this.http.put<CountryDto>(COUNTRY_ENDPOINTS.update(id), request);
}
getCountryById(id: string): Observable<CountryDto> {
return this.http.get<CountryDto>(COUNTRY_ENDPOINTS.getById(id));
}
autocomplete(term = '', limit = 50): Observable<CountryLookupDto[]> {
return this.http.get<CountryLookupDto[]>(COUNTRY_ENDPOINTS.autocomplete, {
params: new HttpParams()
.set('term', term)
.set('limit', limit)
});
}
}