#6384 Redirect to summary when route changes #149
|
@ -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>
|
||||
|
||||
|
|
Loading…
Reference in New Issue