From 380e0782107cb50a1a7acbea6bb1f9c6c15a4f41 Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Sat, 22 Feb 2025 11:43:45 +0900 Subject: [PATCH] Update SystemAccountService.ts --- packages/backend/src/core/SystemAccountService.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/core/SystemAccountService.ts b/packages/backend/src/core/SystemAccountService.ts index 710e797213..1f42bc6a65 100644 --- a/packages/backend/src/core/SystemAccountService.ts +++ b/packages/backend/src/core/SystemAccountService.ts @@ -150,12 +150,16 @@ export class SystemAccountService { const updates = {} as Partial; if (extra.name !== undefined) updates.name = extra.name; - await this.usersRepository.update(user.id, updates); + if (Object.keys(updates).length > 0) { + await this.usersRepository.update(user.id, updates); + } const profileUpdates = {} as Partial; if (extra.description !== undefined) profileUpdates.description = extra.description; - await this.userProfilesRepository.update(user.id, profileUpdates); + if (Object.keys(profileUpdates).length > 0) { + await this.userProfilesRepository.update(user.id, profileUpdates); + } const updated = await this.usersRepository.findOneByOrFail({ id: user.id }) as MiLocalUser; this.cache.set(type, updated);