From 200027e9dfda5563d264786782416f348c03d682 Mon Sep 17 00:00:00 2001 From: Harlan Wilton Date: Fri, 3 Jun 2022 18:12:57 +1000 Subject: [PATCH] fix: use existing where query --- src/runtime/server/api/navigation.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/runtime/server/api/navigation.ts b/src/runtime/server/api/navigation.ts index f6d85a803..46c5c54ae 100644 --- a/src/runtime/server/api/navigation.ts +++ b/src/runtime/server/api/navigation.ts @@ -9,6 +9,11 @@ export default defineEventHandler(async (event) => { const contents = await serverQueryContent(event, query) .where({ + /** + * Partial contents are not included in the navigation + * A partial content is a content that has `_` prefix in its path + */ + _partial: false, /** * Exclude any pages which have opted out of navigation via frontmatter. */ @@ -16,13 +21,6 @@ export default defineEventHandler(async (event) => { $ne: false } }) - .where({ - /** - * Partial contents are not included in the navigation - * A partial content is a content that has `_` prefix in its path - */ - _partial: false - }) .find() const dirConfigs = await serverQueryContent(event).where({ _path: /\/_dir$/i, _partial: true }).find()