summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/i/update.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-04-10 18:13:33 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-04-10 18:13:33 +0900
commit2e3dd2a30a1f3cd6e810c9b6f067ef82b4e4d2f4 (patch)
tree2b434df9b64618ac4df5b895a513f2e34a89e283 /src/server/api/endpoints/i/update.ts
parentFix bug (diff)
downloadsharkey-2e3dd2a30a1f3cd6e810c9b6f067ef82b4e4d2f4.tar.gz
sharkey-2e3dd2a30a1f3cd6e810c9b6f067ef82b4e4d2f4.tar.bz2
sharkey-2e3dd2a30a1f3cd6e810c9b6f067ef82b4e4d2f4.zip
Fix bug
Diffstat (limited to 'src/server/api/endpoints/i/update.ts')
-rw-r--r--src/server/api/endpoints/i/update.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/api/endpoints/i/update.ts b/src/server/api/endpoints/i/update.ts
index ffc90b2f51..3cb514d939 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,