refs #6772: Improve reloadRoute

This commit is contained in:
Javier Segarra 2024-04-18 13:16:14 +02:00
parent 51bc3b6cba
commit 3359d5b6ae
1 changed files with 6 additions and 8 deletions

View File

@ -40,14 +40,12 @@ export function useArrayData(key, userOptions) {
if (!store?.filter?.where) { if (!store?.filter?.where) {
//Cuando el cambio viene por VnSearchbar //Cuando el cambio viene por VnSearchbar
if (route.params.id) store.url = store.url.replace(/(\d+)/, route.params.id); if (route.params.id) store.url = store.url.replace(/(\d+)/, route.params.id);
} else { return;
// Cuando el usuario cambia en la URL }
const keyFk = Object.keys(store.filter.where).find((key) => // Cuando el usuario cambia en la URL
key.endsWith('Fk') const keyFk = Object.keys(store.filter.where).find((key) => key.endsWith('Fk'));
); if (keyFk) {
if (keyFk) { store.filter.where[keyFk] = route.params.id;
store.filter.where[keyFk] = route.params.id;
}
} }
} }