Set HIGHLIGHT as default highlight type in every highlight

This commit is contained in:
Hongbo Wu 2023-03-23 10:44:30 +08:00
parent aae16d7a4d
commit abb8df26e5

View file

@ -475,11 +475,7 @@ export const functionResolvers = {
_: { input: ArticleHighlightsInput },
ctx: WithDataSourcesContext
) {
const highlights = article.highlights?.map((h) => ({
...h,
type: h.type ?? HighlightType.Highlight,
}))
return highlights || []
return article.highlights || []
},
async shareInfo(
article: { id: string; sharedBy?: User; shareInfo?: LinkShareInfo },
@ -538,6 +534,9 @@ export const functionResolvers = {
) {
return highlight.createdByMe ?? highlight.userId === ctx.claims?.uid
},
type(highlight: { type: HighlightType }) {
return highlight.type || HighlightType.Highlight
},
},
Reaction: {
async user(