feat: refs #7925 wip redirect not found
This commit is contained in:
parent
f7de0f09de
commit
c64f87533d
|
@ -262,15 +262,14 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
const { path } = matches.at(-1);
|
const { path } = matches.at(-1);
|
||||||
const rowsNumber = store.data.length;
|
const rowsNumber = store.data.length;
|
||||||
|
|
||||||
if (path.includes(':id') && !rowsNumber)
|
let to;
|
||||||
return router.push({
|
if (path.includes(':id') && !rowsNumber) {
|
||||||
name: 'NotFound',
|
return router.push({ name: 'NotFound' });
|
||||||
});
|
} else if (rowsNumber === 1) {
|
||||||
|
to = path.replace(/\/(list|:id)|-list/, `/${store.data[0].id}`);
|
||||||
const to =
|
} else {
|
||||||
rowsNumber === 1
|
to = path.replace(/:id.*/, '');
|
||||||
? path.replace(/\/(list|:id)|-list/, `/${store.data[0].id}`)
|
}
|
||||||
: path.replace(/:id.*/, '');
|
|
||||||
|
|
||||||
if (route.path != to) {
|
if (route.path != to) {
|
||||||
const pushUrl = { path: to };
|
const pushUrl = { path: to };
|
||||||
|
|
Loading…
Reference in New Issue