Ver código fonte

feat: add country_id to city options and set initial city/state in partner dialog

alvesantos 2 semanas atrás
pai
commit
8e1050f878

+ 1 - 0
src/components/selects/CitySelect.vue

@@ -141,6 +141,7 @@ onMounted(async () => {
       label: city.name,
       value: city.id,
       state_id: city.state_id,
+      country_id: city.country_id,
     }));
     cityOptions.value = baseOptions.value;
     if (initialId) {

+ 2 - 0
src/pages/unit/components/AddEditPartnerDialog.vue

@@ -177,6 +177,7 @@
               label="Estado"
               outlined
               :error-message="validationErrors.state_id"
+              :initial-id="partner?.state_id"
             />
 
             <CitySelect
@@ -188,6 +189,7 @@
               outlined
               :error-message="validationErrors.city_id"
               :state="selectedState"
+              :initial-id="partner?.city_id"
             />
 
             <DefaultInput