Merge pull request #1310 from omnivore-app/fix/update-since-api

Return deleted article in the updatesSince API response
This commit is contained in:
Hongbo Wu 2022-10-14 16:31:00 +08:00 committed by GitHub
commit 8ea727460c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -993,18 +993,13 @@ export const updatesSinceResolver = authorized<
const edges = pages.map((p) => {
const updateReason = getUpdateReason(p, startDate)
return {
node:
updateReason === UpdateReason.Deleted
? null
: ({
...p,
image: p.image && createImageProxyUrl(p.image, 260, 260),
isArchived: !!p.archivedAt,
contentReader:
p.pageType === PageType.File
? ContentReader.Pdf
: ContentReader.Web,
} as SearchItem),
node: {
...p,
image: p.image && createImageProxyUrl(p.image, 260, 260),
isArchived: !!p.archivedAt,
contentReader:
p.pageType === PageType.File ? ContentReader.Pdf : ContentReader.Web,
} as SearchItem,
cursor: endCursor,
itemID: p.id,
updateReason,