fix: refs #8618 update route descriptor to handle empty ticket records and adjust test cases #1478

Merged
jtubau merged 11 commits from 8619-fixRouteExtendedListTest into dev 2025-03-07 10:06:46 +00:00
1 changed files with 4 additions and 2 deletions
Showing only changes of commit 955d2dd5c4 - Show all commits

View File

@ -27,12 +27,14 @@ const getZone = async () => {
const filter = {
where: { routeFk: $props.id ? $props.id : route.params.id },
};
const { data: [firstRecord] = [] } = await axios.get('Tickets/filter', {
const { data } = await axios.get('Tickets/filter', {
jtubau marked this conversation as resolved Outdated

Yo lo simplificaria en data
Ya si después de comprobar si existe data o no, ya desestructuras

Yo lo simplificaria en data Ya si después de comprobar si existe data o no, ya desestructuras

Ok, lo ajusto

Ok, lo ajusto
params: {
filter: JSON.stringify(filter),
},
});
if (!firstRecord) return;
if ( data.length == 0 ) return;
jtubau marked this conversation as resolved Outdated

if (!data.length) return;

if (!data.length) return;
const firstRecord = data[0];
zoneId.value = firstRecord.zoneFk;
const { data: zoneData } = await axios.get(`Zones/${zoneId.value}`);