Skip to content

Commit a2e5c9f

Browse files
committed
fix(query): no trailing slash on path
1 parent 947ccd7 commit a2e5c9f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/runtime/internal/query.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { Collections, CollectionQueryBuilder, SQLOperator } from '@nuxt/content'
2+
import { withoutTrailingSlash } from 'ufo'
23
import { tables } from '#content/manifest'
34

45
export const collectionQureyBuilder = <T extends keyof Collections>(collection: T, fetch: (collection: T, sql: string) => Promise<Collections[T][]>): CollectionQueryBuilder<Collections[T]> => {
@@ -17,7 +18,7 @@ export const collectionQureyBuilder = <T extends keyof Collections>(collection:
1718

1819
const query: CollectionQueryBuilder<Collections[T]> = {
1920
path(path: string) {
20-
return query.where('path', '=', path)
21+
return query.where('path', '=', withoutTrailingSlash(path))
2122
},
2223
skip(skip: number) {
2324
params.offset = skip

0 commit comments

Comments
 (0)