#6384 Redirect to summary when route changes #149

Merged
jsegarra merged 10 commits from 6384_vnSearchbar_redirect into dev 2024-01-11 12:47:29 +00:00
1 changed files with 4 additions and 9 deletions
Showing only changes of commit 8861ee038d - Show all commits

View File

@ -72,15 +72,10 @@ async function search() {
});
if (!props.redirect) return;
const rows = store.data;
const module = route.matched[1];
if (rows.length === 1) {
const [firstRow] = rows;
await router.push({ path: `${module.path}/${firstRow.id}` });
} else if (route.matched.length > 3) {
await router.push({ path: `/${module.path}` });
arrayData.updateStateParams();
}
const { matched: matches } = route;
const { path } = matches[matches.length-1];
const newRoute = path.replace(':id', searchText.value);
await router.push(newRoute);
}
</script>