diff --git a/app/composables/useDistricts.ts b/app/composables/useDistricts.ts index b06cc89a..a783ca19 100644 --- a/app/composables/useDistricts.ts +++ b/app/composables/useDistricts.ts @@ -73,9 +73,9 @@ export function useDistricts(regencyCode: Ref | string | und try { const response = await districtService.getList({ - 'page-size': '50', sort: 'name:asc', - regency_code: code, + 'regency-code': code, + 'page-no-limit': true, }) if (response.success) { diff --git a/app/composables/useProvinces.ts b/app/composables/useProvinces.ts index 86153018..b1fc8609 100644 --- a/app/composables/useProvinces.ts +++ b/app/composables/useProvinces.ts @@ -13,11 +13,11 @@ const error = ref(null) export function useProvinces() { // Computed untuk format SelectItem const provinceOptions = computed(() => { - return provincesCache.value.map(province => ({ + return provincesCache.value.map((province) => ({ label: toTitleCase(province.name), value: province.code, // code: province.code, - searchValue: `${province.code} ${province.name}`.trim() // Untuk search internal combobox + searchValue: `${province.code} ${province.name}`.trim(), // Untuk search internal combobox })) }) @@ -38,8 +38,8 @@ export function useProvinces() { try { const response = await provinceService.getList({ - 'page-no-limit': '1', - 'sort': 'name:asc' + 'page-no-limit': true, + sort: 'name:asc', }) if (response.success) { @@ -59,14 +59,12 @@ export function useProvinces() { // Function untuk mencari province berdasarkan code function getProvinceByCode(code: string): Province | undefined { - return provincesCache.value.find(province => province.code === code) + return provincesCache.value.find((province) => province.code === code) } // Function untuk mencari province berdasarkan name function getProvinceByName(name: string): Province | undefined { - return provincesCache.value.find(province => - province.name.toLowerCase() === name.toLowerCase() - ) + return provincesCache.value.find((province) => province.name.toLowerCase() === name.toLowerCase()) } // Function untuk clear cache (jika diperlukan) diff --git a/app/composables/useRegencies.ts b/app/composables/useRegencies.ts index 780d8dae..9ea233f8 100644 --- a/app/composables/useRegencies.ts +++ b/app/composables/useRegencies.ts @@ -74,9 +74,9 @@ export function useRegencies(provinceCode: Ref | string | un try { const response = await regencyService.getList({ - 'page-size': '50', sort: 'name:asc', - province_code: code, + 'page-no-limit': true, + 'province-code': code, }) if (response.success) { diff --git a/app/composables/useVillages.ts b/app/composables/useVillages.ts index eb5a52f2..68713fe2 100644 --- a/app/composables/useVillages.ts +++ b/app/composables/useVillages.ts @@ -74,9 +74,9 @@ export function useVillages(districtCode: Ref | string | und try { const response = await villageService.getList({ - 'page-size': '50', sort: 'name:asc', - district_code: code, + 'district-code': code, + 'page-no-limit': true, }) if (response.success) {