mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Merge pull request #1976 from omnivore-app/fix/null-pageType
Fix pageType to be null in updatesSince api response
This commit is contained in:
commit
95b77b6866
3 changed files with 9 additions and 5 deletions
|
|
@ -1,14 +1,15 @@
|
|||
import { ResponseError } from '@elastic/elasticsearch/lib/errors'
|
||||
import { EntityType } from '../datalayer/pubsub'
|
||||
import { SortBy, SortOrder, SortParams } from '../utils/search'
|
||||
import { client, INDEX_ALIAS } from './index'
|
||||
import {
|
||||
Highlight,
|
||||
Page,
|
||||
PageContext,
|
||||
PageType,
|
||||
SearchItem,
|
||||
SearchResponse,
|
||||
} from './types'
|
||||
import { ResponseError } from '@elastic/elasticsearch/lib/errors'
|
||||
import { client, INDEX_ALIAS } from './index'
|
||||
import { SortBy, SortOrder, SortParams } from '../utils/search'
|
||||
import { EntityType } from '../datalayer/pubsub'
|
||||
|
||||
export const addHighlightToPage = async (
|
||||
id: string,
|
||||
|
|
@ -241,6 +242,7 @@ export const searchHighlights = async (
|
|||
...highlight,
|
||||
...hit._source,
|
||||
pageId: hit._id,
|
||||
pageType: PageType.Highlights,
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -946,7 +946,7 @@ export const searchResolver = authorized<
|
|||
originalArticleUrl: r.url,
|
||||
publishedAt: validatedDate(r.publishedAt),
|
||||
ownedByViewer: r.userId === claims.uid,
|
||||
pageType: r.pageType || PageType.Highlights,
|
||||
pageType: r.pageType || PageType.Unknown,
|
||||
siteIcon,
|
||||
} as SearchItem,
|
||||
cursor: endCursor,
|
||||
|
|
@ -1058,6 +1058,7 @@ export const updatesSinceResolver = authorized<
|
|||
p.pageType === PageType.File
|
||||
? ContentReader.Pdf
|
||||
: ContentReader.Web,
|
||||
pageType: p.pageType || PageType.Unknown,
|
||||
} as SearchItem,
|
||||
cursor: endCursor,
|
||||
itemID: p.id,
|
||||
|
|
|
|||
|
|
@ -1064,6 +1064,7 @@ describe('Article API', () => {
|
|||
id
|
||||
createdAt
|
||||
updatedAt
|
||||
pageType
|
||||
}
|
||||
itemID
|
||||
updateReason
|
||||
|
|
|
|||
Loading…
Reference in a new issue