mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-22 01:47:39 -07:00
[backend] Fix UserListJoining delete query on unfollow
This commit is contained in:
parent
c7dc059116
commit
10865168bf
1 changed files with 4 additions and 1 deletions
|
@ -45,7 +45,10 @@ export default async function (
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await UserListJoinings.delete({ userId: followee.id, userList: { userId: follower.id } });
|
const ids = await UserListJoinings.find({ where: { userId: followee.id, userList: { userId: follower.id } }, select: ["id"] })
|
||||||
|
.then(p => p.map(x => x.id));
|
||||||
|
|
||||||
|
if (ids.length > 0) await UserListJoinings.delete(ids);
|
||||||
await Followings.delete(following.id);
|
await Followings.delete(following.id);
|
||||||
|
|
||||||
decrementFollowing(follower, followee);
|
decrementFollowing(follower, followee);
|
||||||
|
|
Loading…
Reference in a new issue