Fixes Issue #2 Client cannot fetch User Profile settings

This commit is contained in:
Crimekillz 2024-04-08 00:08:12 +02:00
parent 6f941399a0
commit 61ace17fc9

View File

@ -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)