perf: minor changes
gitea/salix-front/pipeline/pr-test This commit looks good Details

This commit is contained in:
Javier Segarra 2025-02-19 00:12:01 +01:00
parent ce15bdd99e
commit f33d396d82
2 changed files with 8 additions and 7 deletions

View File

@ -8,7 +8,7 @@ export async function getAgencies(formData, client, _filter = {}) {
order: ['name ASC'],
};
let defaultAgency = null;
let agency = null;
let params = {
filter: JSON.stringify(filter),
warehouseFk: formData.warehouseId,
@ -16,13 +16,15 @@ export async function getAgencies(formData, client, _filter = {}) {
landed: formData.landed,
};
const { data } = await axios.get('Agencies/getAgenciesWithWarehouse', { params });
const { data: options } = await axios.get('Agencies/getAgenciesWithWarehouse', {
params,
});
if (data && client) {
defaultAgency = data.find(
(agency) => agency.agencyModeFk === client.defaultAddress.agencyModeFk,
if (options && client) {
agency = options.find(
({ agencyModeFk }) => agencyModeFk === client.defaultAddress.agencyModeFk,
);
}
return { options: data, agency: defaultAgency };
return { options, agency };
}

View File

@ -478,7 +478,6 @@ watch(
auto-load
/>
<VnSection
ref="sectionRef"
:data-key="dataKey"
:columns="columns"
prefix="card"