tickera-angular-components 0.0.1-dev.144 → 0.0.1-dev.146

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2796,14 +2796,8 @@ class CitiesService {
2796
2796
  constructor(apiService) {
2797
2797
  this.apiService = apiService;
2798
2798
  }
2799
- fetchCities({ page, search, stateId }) {
2800
- const queryParams = new URLSearchParams();
2801
- if (page)
2802
- queryParams.append('page', page.toString());
2803
- if (search)
2804
- queryParams.append('search', search);
2805
- if (stateId)
2806
- queryParams.append('state_id', stateId.toString());
2799
+ fetchCities(params) {
2800
+ const queryParams = transformUrlParams(params);
2807
2801
  const queryString = queryParams.toString();
2808
2802
  const apiRoute = `${CITY_API_ENDPOINTS.findAll}${queryString ? '?' + queryString : ''}`;
2809
2803
  return this.apiService.get(apiRoute);
@@ -2830,12 +2824,8 @@ class CountryService {
2830
2824
  constructor(apiService) {
2831
2825
  this.apiService = apiService;
2832
2826
  }
2833
- fetchCountries(page, search) {
2834
- const queryParams = new URLSearchParams();
2835
- if (page)
2836
- queryParams.append('page', page.toString());
2837
- if (search)
2838
- queryParams.append('search', search);
2827
+ fetchCountries(params) {
2828
+ const queryParams = transformUrlParams(params);
2839
2829
  const queryString = queryParams.toString();
2840
2830
  const apiRoute = `${COUNTRY_API_ENDPOINTS.findAll}${queryString ? '?' + queryString : ''}`;
2841
2831
  return this.apiService.get(apiRoute);
@@ -2862,14 +2852,8 @@ class StatesService {
2862
2852
  constructor(apiService) {
2863
2853
  this.apiService = apiService;
2864
2854
  }
2865
- fetchStates(page, search, countryId) {
2866
- const queryParams = new URLSearchParams();
2867
- if (page)
2868
- queryParams.append('page', page.toString());
2869
- if (search)
2870
- queryParams.append('search', search);
2871
- if (countryId)
2872
- queryParams.append('country_id', countryId.toString());
2855
+ fetchStates(params) {
2856
+ const queryParams = transformUrlParams(params);
2873
2857
  const queryString = queryParams.toString();
2874
2858
  const apiRoute = `${STATE_API_ENDPOINTS.findAll}${queryString ? '?' + queryString : ''}`;
2875
2859
  return this.apiService.get(apiRoute);
@@ -7035,7 +7019,7 @@ class CountrySelectComponent {
7035
7019
  loadCountries() {
7036
7020
  this.loading.set(true);
7037
7021
  this.countryService
7038
- .fetchCountries()
7022
+ .fetchCountries({})
7039
7023
  .pipe(takeUntil(this.destroy$))
7040
7024
  .subscribe({
7041
7025
  next: ({ data: { countries } }) => {
@@ -7164,7 +7148,7 @@ class StateSelectComponent {
7164
7148
  loadStates() {
7165
7149
  this.loading = true;
7166
7150
  this.statesService
7167
- .fetchStates(1, undefined, this.countryId)
7151
+ .fetchStates({ countryId: this.countryId })
7168
7152
  .pipe(takeUntil(this.destroy$))
7169
7153
  .subscribe({
7170
7154
  next: ({ data: { states } }) => {