From 4399e25398e1b61aec55c9dd2f21fffb42b6f13b Mon Sep 17 00:00:00 2001 From: naskya Date: Wed, 27 Dec 2023 05:18:01 +0900 Subject: [PATCH] fix: profile updates fail if language isn't specified --- packages/backend/src/server/api/endpoints/i/update.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/i/update.ts b/packages/backend/src/server/api/endpoints/i/update.ts index 7b900a74a..a3d5f4d6d 100644 --- a/packages/backend/src/server/api/endpoints/i/update.ts +++ b/packages/backend/src/server/api/endpoints/i/update.ts @@ -160,7 +160,7 @@ export default define(meta, paramDef, async (ps, _user, token) => { if (ps.name !== undefined) updates.name = ps.name; if (ps.description !== undefined) profileUpdates.description = ps.description; - if (ps.lang !== undefined) profileUpdates.lang = ps.lang; + if (typeof ps.lang === "string") profileUpdates.lang = ps.lang; if (ps.location !== undefined) profileUpdates.location = ps.location; if (ps.birthday !== undefined) profileUpdates.birthday = ps.birthday; if (ps.ffVisibility !== undefined) @@ -189,7 +189,7 @@ export default define(meta, paramDef, async (ps, _user, token) => { profileUpdates.mutedInstances = ps.mutedInstances; if (ps.mutingNotificationTypes !== undefined) profileUpdates.mutingNotificationTypes = - ps.mutingNotificationTypes as typeof notificationTypes[number][]; + ps.mutingNotificationTypes as (typeof notificationTypes)[number][]; if (typeof ps.isLocked === "boolean") updates.isLocked = ps.isLocked; if (typeof ps.isExplorable === "boolean") updates.isExplorable = ps.isExplorable;