From 2e3dd2a30a1f3cd6e810c9b6f067ef82b4e4d2f4 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 10 Apr 2019 18:13:33 +0900 Subject: [PATCH] Fix bug --- src/server/api/endpoints/i/update.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/api/endpoints/i/update.ts b/src/server/api/endpoints/i/update.ts index ffc90b2f5..3cb514d93 100644 --- a/src/server/api/endpoints/i/update.ts +++ b/src/server/api/endpoints/i/update.ts @@ -223,8 +223,8 @@ export default define(meta, async (ps, user, app) => { for (const tag of user.tags.filter(x => !tags.includes(x))) updateHashtag(user, tag, true, false); //#endregion - await Users.update(user.id, updates); - await UserProfiles.update({ userId: user.id }, profile); + if (Object.keys(updates).length > 0) await Users.update(user.id, updates); + if (Object.keys(profile).length > 0) await UserProfiles.update({ userId: user.id }, profile); const iObj = await Users.pack(user.id, user, { detail: true,