From d1cf1b5611917d864a5c6efa6177eed86453871b Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Thu, 19 Oct 2023 00:57:09 +0200 Subject: [PATCH] [backend] Remove user from list on unfollow --- packages/backend/src/services/following/delete.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/services/following/delete.ts b/packages/backend/src/services/following/delete.ts index fae4bd3ce..7a5d43395 100644 --- a/packages/backend/src/services/following/delete.ts +++ b/packages/backend/src/services/following/delete.ts @@ -7,7 +7,7 @@ import { deliver, webhookDeliver } from "@/queue/index.js"; import Logger from "../logger.js"; import { registerOrFetchInstanceDoc } from "../register-or-fetch-instance-doc.js"; import type { User } from "@/models/entities/user.js"; -import { Followings, Users, Instances } from "@/models/index.js"; +import { Followings, Users, Instances, UserListJoinings } from "@/models/index.js"; import { instanceChart, perUserFollowingChart, @@ -45,6 +45,7 @@ export default async function ( return; } + await UserListJoinings.delete({ userId: followee.id, userList: { userId: follower.id } }); await Followings.delete(following.id); decrementFollowing(follower, followee);