forked from FoundKeyGang/FoundKey
client: fix 500 error in notifications
closes FoundKeyGang/FoundKey#73 Changelog: Fixed
This commit is contained in:
parent
3aaa9facc6
commit
0fbd7fa492
1 changed files with 6 additions and 1 deletions
|
@ -1,3 +1,4 @@
|
|||
import { db } from '@/db/postgre.js';
|
||||
import { publishMainStream, publishUserEvent } from '@/services/stream.js';
|
||||
import { renderActivity } from '@/remote/activitypub/renderer/index.js';
|
||||
import renderFollow from '@/remote/activitypub/renderer/follow.js';
|
||||
|
@ -24,7 +25,11 @@ export default async function(follower: { id: User['id']; host: User['host']; ur
|
|||
return;
|
||||
}
|
||||
|
||||
await Followings.delete(following.id);
|
||||
await Promise.all([
|
||||
Followings.delete(following.id),
|
||||
// delete notifications that the ex-follower can now no longer see
|
||||
db.query('DELETE FROM "notification" WHERE "noteId" IS NOT NULL AND "notifieeId" = $1 AND NOT note_visible("noteId", "notifieeId")', [follower.id]),
|
||||
]);
|
||||
|
||||
decrementFollowing(follower, followee);
|
||||
|
||||
|
|
Loading…
Reference in a new issue