diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue index aaf197d74..568a35c61 100644 --- a/src/components/ui/VnSearchbar.vue +++ b/src/components/ui/VnSearchbar.vue @@ -91,12 +91,6 @@ async function search() { if (!props.redirect) return; - if (props.customRouteRedirectName) - return router.push({ - name: props.customRouteRedirectName, - params: { id: searchText.value }, - }); - const { matched: matches } = router.currentRoute.value; const { path } = matches.at(-1); const [, moduleName] = path.split('/'); @@ -105,6 +99,13 @@ async function search() { return router.push({ path: `/${moduleName}/list` }); const targetId = store.data[0].id; + + if (props.customRouteRedirectName && targetId) + return router.push({ + name: props.customRouteRedirectName, + params: { id: targetId }, + }); + let targetUrl; if (path.endsWith('/list')) targetUrl = path.replace('/list', `/${targetId}/summary`); diff --git a/src/pages/Zone/Card/ZoneCard.vue b/src/pages/Zone/Card/ZoneCard.vue index 9d6895f36..d8c51afe7 100644 --- a/src/pages/Zone/Card/ZoneCard.vue +++ b/src/pages/Zone/Card/ZoneCard.vue @@ -8,7 +8,7 @@ import ZoneDescriptor from './ZoneDescriptor.vue'; base-url="Zones" :descriptor="ZoneDescriptor" searchbar-data-key="ZoneList" - searchbar-url="Zones/filter" + searchbar-url="Zones" searchbar-label="Search zones" searchbar-info="You can search by zone reference" /> diff --git a/src/pages/Zone/Card/ZoneDescriptor.vue b/src/pages/Zone/Card/ZoneDescriptor.vue index 8f0aa9e07..aee6174a3 100644 --- a/src/pages/Zone/Card/ZoneDescriptor.vue +++ b/src/pages/Zone/Card/ZoneDescriptor.vue @@ -73,7 +73,6 @@ const setData = (entity) => { -->