mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Merge pull request #529 from omnivore-app/feature/lookup-article-by-id
Allow looking up articles by ID
This commit is contained in:
commit
daa60d55ed
1 changed files with 5 additions and 1 deletions
|
|
@ -426,7 +426,11 @@ export const getArticleResolver: ResolverFn<
|
|||
})
|
||||
await createIntercomEvent('get-article', claims.uid)
|
||||
|
||||
const page = await getPageByParam({ userId: claims.uid, slug })
|
||||
// We allow the backend to use the ID instead of a slug to fetch the article
|
||||
const page =
|
||||
(await getPageByParam({ userId: claims.uid, slug })) ||
|
||||
(await getPageByParam({ userId: claims.uid, _id: slug }))
|
||||
|
||||
if (!page) {
|
||||
return { errorCodes: [ArticleErrorCode.NotFound] }
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue