fix: add agencyModeFk to selectedClient #1560

Merged
jsegarra merged 8 commits from hotfix_fixGetAgenciesTicketList into master 2025-03-06 00:30:22 +00:00
2 changed files with 2 additions and 4 deletions
Showing only changes of commit a812fc1720 - Show all commits

View File

@ -21,9 +21,7 @@ export async function getAgencies(formData, client, _filter = {}) {
});
if (options && client) {
agency = options.find(
({ agencyModeFk }) => agencyModeFk === client.defaultAddress.agencyModeFk,
);
agency = options.find(({ agencyModeFk }) => agencyModeFk === client.agencyModeFk);
}
return { options, agency };

View File

@ -271,7 +271,7 @@ const fetchAddresses = async (formData) => {
formInitialData.value = { clientId: formData.clientId };
if (!data) return;
addressesOptions.value = data;
selectedClient.value = data[0].client;
selectedClient.value = { ...data[0].client, agencyModeFk: data[0].agencyModeFk };
formData.addressId = selectedClient.value.defaultAddressFk;
formInitialData.value.addressId = formData.addressId;
};