only recommend highlights created by the user

This commit is contained in:
Hongbo Wu 2022-12-13 12:12:20 +08:00
parent 25842270d7
commit 918ada2100

View file

@ -204,8 +204,9 @@ export const recommendResolver = authorized<
}
}
// only recommend highlights created by the user
const recommendedHighlightIds = input.recommendedWithHighlights
? page.highlights?.map((h) => h.id)
? page.highlights?.filter((h) => h.userId === uid)?.map((h) => h.id)
: undefined
const exp = Math.floor(Date.now() / 1000) + 60 * 60 * 24 // 1 day