Skip to content

Commit

Permalink
chore: comments
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Aug 4, 2022
1 parent 2bf5cb7 commit 95f714f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/runtime/server/api/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { isPreview } from '../preview'
export default defineEventHandler(async (event) => {
const query = getContentQuery(event)

// Read from cache if not preview and there is no query
if (!isPreview(event) && Object.keys(query).length === 0) {
const cache = cacheStorage.getItem('content-navigation.json')
if (cache) {
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/server/content-index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export async function getIndexedContentsList<T = ParsedContent> (event: Compatib
const params = query.params()
const path = params?.where?.find(wh => wh._path)?._path

// Index is available for string and RegExp paths
// Read from Index is not preview and path is string or RegExp
if (!isPreview(event) && (typeof path === 'string' || path instanceof RegExp)) {
const index = await getContentIndex(event)
const keys = Object.keys(index)
Expand Down

0 comments on commit 95f714f

Please sign in to comment.