fix type of highlight is null from update since api
This commit is contained in:
@ -27,6 +27,7 @@ import { findLabelsByLibraryItemId } from '../services/labels'
|
||||
import { findRecommendationsByLibraryItemId } from '../services/recommendation'
|
||||
import { findUploadFileById } from '../services/upload_file'
|
||||
import {
|
||||
highlightDataToHighlight,
|
||||
isBase64Image,
|
||||
recommandationDataToRecommendation,
|
||||
validatedDate,
|
||||
@ -451,7 +452,8 @@ export const functionResolvers = {
|
||||
if (item.highlights) return item.highlights
|
||||
|
||||
if (item.highlightAnnotations && item.highlightAnnotations.length > 0) {
|
||||
return findHighlightsByLibraryItemId(item.id, ctx.uid)
|
||||
const highlights = await findHighlightsByLibraryItemId(item.id, ctx.uid)
|
||||
return highlights.map(highlightDataToHighlight)
|
||||
}
|
||||
|
||||
return []
|
||||
|
||||
@ -13,6 +13,7 @@ import { User } from '../../src/entity/user'
|
||||
import {
|
||||
ArticleSavingRequestStatus,
|
||||
BulkActionType,
|
||||
HighlightType,
|
||||
PageType,
|
||||
SyncUpdatedItemEdge,
|
||||
UpdateReason,
|
||||
@ -1963,6 +1964,7 @@ describe('Article API', () => {
|
||||
pageType
|
||||
highlights {
|
||||
id
|
||||
type
|
||||
}
|
||||
}
|
||||
itemID
|
||||
@ -2084,6 +2086,9 @@ describe('Article API', () => {
|
||||
expect(res.body.data.updatesSince.edges[0].node.highlights[0].id).to.eq(
|
||||
highlight.id
|
||||
)
|
||||
expect(res.body.data.updatesSince.edges[0].node.highlights[0].type).to.eq(
|
||||
HighlightType.Highlight
|
||||
)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user