From 71e9b2298ebf29a8148bf467301a37bb421cb343 Mon Sep 17 00:00:00 2001 From: Namekuji Date: Sat, 15 Apr 2023 05:11:31 -0400 Subject: [PATCH] fix copying mutings --- packages/backend/src/core/AccountMoveService.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/core/AccountMoveService.ts b/packages/backend/src/core/AccountMoveService.ts index 8056803dfe..bbcb8c66cc 100644 --- a/packages/backend/src/core/AccountMoveService.ts +++ b/packages/backend/src/core/AccountMoveService.ts @@ -185,7 +185,12 @@ export class AccountMoveService { @bindThis public async copyMutings(src: ThinUser, dst: ThinUser): Promise { // Insert new mutings with the same values except mutee - const mutings = await this.mutingsRepository.findBy({ muteeId: src.id }); + const mutings = await this.mutingsRepository.find({ + relations: { + muter: true, + }, + where: { muteeId: src.id } + }); const newMuting: Partial[] = []; for (const muting of mutings) { newMuting.push({ @@ -196,7 +201,7 @@ export class AccountMoveService { muteeId: dst.id, }); } - this.mutingsRepository.insert(mutings); // no need to wait + await this.mutingsRepository.insert(mutings); for (const mute of mutings) { if (mute.muter) this.cacheService.userMutingsCache.refresh(mute.muter.id); }