From 61ace17fc9442dc659b39ce2d64f742f35a12c09 Mon Sep 17 00:00:00 2001 From: Crimekillz Date: Mon, 8 Apr 2024 00:08:12 +0200 Subject: [PATCH] Fixes Issue #2 Client cannot fetch User Profile settings --- 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 20ccfd5e8..31af07cfb 100644 --- a/packages/backend/src/server/api/endpoints/i/update.ts +++ b/packages/backend/src/server/api/endpoints/i/update.ts @@ -91,7 +91,7 @@ export const paramDef = { birthday: { ...Users.birthdaySchema, nullable: true }, lang: { type: "string", - enum: Object.keys(langmap), + enum: [null, ...Object.keys(langmap)], nullable: true, }, avatarId: { type: "string", format: "misskey:id", nullable: true }, @@ -159,7 +159,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 (typeof ps.lang === "string") profileUpdates.lang = ps.lang; + if (ps.lang !== undefined) profileUpdates.lang = ps.lang; if (ps.location !== undefined) profileUpdates.location = ps.location; if (ps.birthday !== undefined) profileUpdates.birthday = ps.birthday; if (ps.ffVisibility !== undefined)