tickera-angular-components 0.0.1-dev.143 → 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.
@@ -2768,14 +2768,8 @@ class AdminService {
2768
2768
  constructor(apiService) {
2769
2769
  this.apiService = apiService;
2770
2770
  }
2771
- fetchAdmins(page = 1, search = '', limit = 20) {
2772
- const queryParams = new URLSearchParams();
2773
- if (page)
2774
- queryParams.append('page', page.toString());
2775
- if (search)
2776
- queryParams.append('search', search);
2777
- if (limit)
2778
- queryParams.append('limit', limit.toString());
2771
+ fetchAdmins(params) {
2772
+ const queryParams = transformUrlParams(params);
2779
2773
  const queryString = queryParams.toString();
2780
2774
  const apiRoute = `${ADMIN_API_ROUTES.FIND_ALL}${queryString ? '?' + queryString : ''}`;
2781
2775
  return this.apiService.get(apiRoute);
@@ -2802,14 +2796,8 @@ class CitiesService {
2802
2796
  constructor(apiService) {
2803
2797
  this.apiService = apiService;
2804
2798
  }
2805
- fetchCities({ page, search, stateId }) {
2806
- const queryParams = new URLSearchParams();
2807
- if (page)
2808
- queryParams.append('page', page.toString());
2809
- if (search)
2810
- queryParams.append('search', search);
2811
- if (stateId)
2812
- queryParams.append('state_id', stateId.toString());
2799
+ fetchCities(params) {
2800
+ const queryParams = transformUrlParams(params);
2813
2801
  const queryString = queryParams.toString();
2814
2802
  const apiRoute = `${CITY_API_ENDPOINTS.findAll}${queryString ? '?' + queryString : ''}`;
2815
2803
  return this.apiService.get(apiRoute);
@@ -2836,12 +2824,8 @@ class CountryService {
2836
2824
  constructor(apiService) {
2837
2825
  this.apiService = apiService;
2838
2826
  }
2839
- fetchCountries(page, search) {
2840
- const queryParams = new URLSearchParams();
2841
- if (page)
2842
- queryParams.append('page', page.toString());
2843
- if (search)
2844
- queryParams.append('search', search);
2827
+ fetchCountries(params) {
2828
+ const queryParams = transformUrlParams(params);
2845
2829
  const queryString = queryParams.toString();
2846
2830
  const apiRoute = `${COUNTRY_API_ENDPOINTS.findAll}${queryString ? '?' + queryString : ''}`;
2847
2831
  return this.apiService.get(apiRoute);
@@ -2868,14 +2852,8 @@ class StatesService {
2868
2852
  constructor(apiService) {
2869
2853
  this.apiService = apiService;
2870
2854
  }
2871
- fetchStates(page, search, countryId) {
2872
- const queryParams = new URLSearchParams();
2873
- if (page)
2874
- queryParams.append('page', page.toString());
2875
- if (search)
2876
- queryParams.append('search', search);
2877
- if (countryId)
2878
- queryParams.append('country_id', countryId.toString());
2855
+ fetchStates(params) {
2856
+ const queryParams = transformUrlParams(params);
2879
2857
  const queryString = queryParams.toString();
2880
2858
  const apiRoute = `${STATE_API_ENDPOINTS.findAll}${queryString ? '?' + queryString : ''}`;
2881
2859
  return this.apiService.get(apiRoute);
@@ -6773,7 +6751,7 @@ class AdminSelectComponent {
6773
6751
  loadAdmins() {
6774
6752
  this.loading.set(true);
6775
6753
  this.adminService
6776
- .fetchAdmins()
6754
+ .fetchAdmins({})
6777
6755
  .pipe(takeUntil(this.destroy$))
6778
6756
  .subscribe({
6779
6757
  next: ({ data: { admins } }) => {
@@ -7041,7 +7019,7 @@ class CountrySelectComponent {
7041
7019
  loadCountries() {
7042
7020
  this.loading.set(true);
7043
7021
  this.countryService
7044
- .fetchCountries()
7022
+ .fetchCountries({})
7045
7023
  .pipe(takeUntil(this.destroy$))
7046
7024
  .subscribe({
7047
7025
  next: ({ data: { countries } }) => {
@@ -7170,7 +7148,7 @@ class StateSelectComponent {
7170
7148
  loadStates() {
7171
7149
  this.loading = true;
7172
7150
  this.statesService
7173
- .fetchStates(1, undefined, this.countryId)
7151
+ .fetchStates({ countryId: this.countryId })
7174
7152
  .pipe(takeUntil(this.destroy$))
7175
7153
  .subscribe({
7176
7154
  next: ({ data: { states } }) => {