Make remove-all-following remove follows in both directions

This commit is contained in:
PrivateGER 2024-10-05 19:58:58 +02:00
parent b3f925c426
commit 996d079476

View file

@ -37,9 +37,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queueService: QueueService,
) {
super(meta, paramDef, async (ps, me) => {
const followings = await this.followingsRepository.findBy({
followerHost: ps.host,
});
const followings = await this.followingsRepository.findBy([
{
followeeHost: ps.host,
},
{
followerHost: ps.host,
},
]);
const pairs = await Promise.all(followings.map(f => Promise.all([
this.usersRepository.findOneByOrFail({ id: f.followerId }),