mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Allow looking up articles by ID
iOS needs to be able to lookup an article by its ID not its slug, because the slug can change once saved.
This commit is contained in:
parent
fedd92488b
commit
453b301e74
1 changed files with 3 additions and 1 deletions
|
|
@ -426,7 +426,9 @@ 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