Skip to content

Commit e280688

Browse files
committed
fix: make category ids acts as folder
1 parent cb2b96f commit e280688

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pages/embedded.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ if (boundary && typeof boundary === 'string' && settings.value!.polygons_extra)
5555
if (route.params.p1) {
5656
const match = route.params.p1.toString().match(regexForCategoryIds)
5757
58-
if (!match || (!route.path.endsWith('/') && match.groups && (match.groups.cartocode || match.groups.reference || match.groups.osm)))
58+
if (!match || (route.path.endsWith('/') && match.groups && (match.groups.cartocode || match.groups.reference || match.groups.osm)))
5959
throw createError({ statusCode: 400, message: `No match for category ID: ${route.params.p1}` })
6060
6161
categoryIds.value = match.input?.split(',').map(id => Number.parseInt(id))
6262
}
6363
6464
// Get POI ID from URL
65-
if (categoryIds.value?.length === 1 && route.name === 'index-p1' && route.path.endsWith('/')) {
65+
if (categoryIds.value?.length === 1 && route.name === 'index-p1' && !route.path.endsWith('/')) {
6666
poiId.value = route.params.p1?.toString()
6767
categoryIds.value = undefined
6868
}

pages/index.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ if (boundary && typeof boundary === 'string' && settings.value!.polygons_extra)
5555
if (route.params.p1) {
5656
const match = route.params.p1.toString().match(regexForCategoryIds)
5757
58-
if (!match || (!route.path.endsWith('/') && match.groups && (match.groups.cartocode || match.groups.reference || match.groups.osm)))
58+
if (!match || (route.path.endsWith('/') && match.groups && (match.groups.cartocode || match.groups.reference || match.groups.osm)))
5959
throw createError({ statusCode: 400, message: `No match for category ID: ${route.params.p1}` })
6060
6161
categoryIds.value = match.input?.split(',').map(id => Number.parseInt(id))
6262
}
6363
6464
// Get POI ID from URL
65-
if (categoryIds.value?.length === 1 && route.name === 'index-p1' && route.path.endsWith('/')) {
65+
if (categoryIds.value?.length === 1 && route.name === 'index-p1' && !route.path.endsWith('/')) {
6666
poiId.value = route.params.p1?.toString()
6767
categoryIds.value = undefined
6868
}

0 commit comments

Comments
 (0)