fix: add agencyModeFk to selectedClient
gitea/salix-front/pipeline/pr-master There was a failure building this commit Details

This commit is contained in:
Jose Antonio Tubau 2025-03-05 21:45:50 +01:00
parent 6d59dc93a2
commit a812fc1720
2 changed files with 2 additions and 4 deletions

View File

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

View File

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