forked from FoundKeyGang/FoundKey
server: catch unresolvable featured notes
Instead of throwing all featured notes away, just remove that specific one. closes FoundKeyGang/FoundKey#407
This commit is contained in:
parent
4aae4a5ffb
commit
6123df0ebd
1 changed files with 1 additions and 1 deletions
|
@ -464,7 +464,7 @@ async function updateFeatured(userId: User['id'], resolver: Resolver) {
|
||||||
const featuredNotes = await Promise.all(items
|
const featuredNotes = await Promise.all(items
|
||||||
.filter(item => isPost(item))
|
.filter(item => isPost(item))
|
||||||
.slice(0, 5)
|
.slice(0, 5)
|
||||||
.map(item => limit(() => resolveNote(item, resolver))));
|
.map(item => limit(() => resolveNote(item, resolver).catch(() => null))));
|
||||||
|
|
||||||
await db.transaction(async transactionalEntityManager => {
|
await db.transaction(async transactionalEntityManager => {
|
||||||
await transactionalEntityManager.delete(UserNotePining, { userId: user.id });
|
await transactionalEntityManager.delete(UserNotePining, { userId: user.id });
|
||||||
|
|
Loading…
Reference in a new issue