diff --git a/pages/embedded.vue b/pages/embedded.vue index 9186d9ff..e1dfb5a7 100644 --- a/pages/embedded.vue +++ b/pages/embedded.vue @@ -55,14 +55,14 @@ if (boundary && typeof boundary === 'string' && settings.value!.polygons_extra) if (route.params.p1) { const match = route.params.p1.toString().match(regexForCategoryIds) - if (!match || (!route.path.endsWith('/') && match.groups && (match.groups.cartocode || match.groups.reference || match.groups.osm))) + if (!match || (route.path.endsWith('/') && match.groups && (match.groups.cartocode || match.groups.reference || match.groups.osm))) throw createError({ statusCode: 400, message: `No match for category ID: ${route.params.p1}` }) categoryIds.value = match.input?.split(',').map(id => Number.parseInt(id)) } // Get POI ID from URL -if (categoryIds.value?.length === 1 && route.name === 'index-p1' && route.path.endsWith('/')) { +if (categoryIds.value?.length === 1 && route.name === 'index-p1' && !route.path.endsWith('/')) { poiId.value = route.params.p1?.toString() categoryIds.value = undefined } diff --git a/pages/index.vue b/pages/index.vue index 158515ad..af35b560 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -55,14 +55,14 @@ if (boundary && typeof boundary === 'string' && settings.value!.polygons_extra) if (route.params.p1) { const match = route.params.p1.toString().match(regexForCategoryIds) - if (!match || (!route.path.endsWith('/') && match.groups && (match.groups.cartocode || match.groups.reference || match.groups.osm))) + if (!match || (route.path.endsWith('/') && match.groups && (match.groups.cartocode || match.groups.reference || match.groups.osm))) throw createError({ statusCode: 400, message: `No match for category ID: ${route.params.p1}` }) categoryIds.value = match.input?.split(',').map(id => Number.parseInt(id)) } // Get POI ID from URL -if (categoryIds.value?.length === 1 && route.name === 'index-p1' && route.path.endsWith('/')) { +if (categoryIds.value?.length === 1 && route.name === 'index-p1' && !route.path.endsWith('/')) { poiId.value = route.params.p1?.toString() categoryIds.value = undefined }