Skip to content

Commit

Permalink
fix(query): invalid response on missing content (#1706)
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Nov 23, 2022
1 parent 29f088c commit 5197dab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/server/api/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default defineEventHandler(async (event) => {
const path = content?._path || query.where?.find(w => w._path)?._path as string
if (path) {
const _dir = await serverQueryContent(event).where({ _path: join(path, '_dir') }).without('_').findOne()
if (!Array.isArray(_dir)) {
if (_dir && !Array.isArray(_dir)) {
return {
_path: path,
...(content || {}),
Expand Down

0 comments on commit 5197dab

Please sign in to comment.