mirror of
https://example.com
synced 2024-11-22 12:36:40 +09:00
fix: undefine unspecified parameters on profile updates
This commit is contained in:
parent
bdbe8a046b
commit
f676cc1f19
2 changed files with 7 additions and 7 deletions
|
@ -118,7 +118,7 @@ export const paramDef = {
|
|||
preventAiLearning: { type: "boolean" },
|
||||
isBot: { type: "boolean" },
|
||||
isCat: { type: "boolean" },
|
||||
speakAsCat: { type: "boolean" },
|
||||
speakAsCat: { type: "boolean", nullable: true },
|
||||
isIndexable: { type: "boolean" },
|
||||
injectFeaturedNote: { type: "boolean" },
|
||||
receiveAnnouncementEmail: { type: "boolean" },
|
||||
|
|
|
@ -231,14 +231,14 @@ function saveFields() {
|
|||
|
||||
function save() {
|
||||
os.apiWithDialog("i/update", {
|
||||
name: profile.name || null,
|
||||
description: profile.description || null,
|
||||
location: profile.location || null,
|
||||
birthday: profile.birthday || null,
|
||||
lang: profile.lang || null,
|
||||
name: profile.name ?? undefined,
|
||||
description: profile.description ?? undefined,
|
||||
location: profile.location ?? undefined,
|
||||
birthday: profile.birthday ?? undefined,
|
||||
lang: profile.lang ?? undefined,
|
||||
isBot: !!profile.isBot,
|
||||
isCat: !!profile.isCat,
|
||||
speakAsCat: !!profile.speakAsCat,
|
||||
speakAsCat: profile.isCat ? !!profile.speakAsCat : undefined,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue