fix: draft finding

This commit is contained in:
DIYgod 2023-05-04 20:51:23 +01:00
parent 9daf35a586
commit efccf96736
No known key found for this signature in database
1 changed files with 4 additions and 1 deletions

View File

@ -380,7 +380,10 @@ export async function getPage<TRender extends boolean = false>(input: {
characterId: input.characterId,
handle: input.handle,
})
const localPages = local.filter((page) => page.draftKey === input.noteId + "")
const localPages = local.filter(
(page) =>
page.draftKey === input.noteId + "" || page.draftKey === input.slug,
)
const localPage =
localPages.length &&
localPages.reduce((prev, current) => {