fix: Don't provide lang when no language is selected

This commit is contained in:
Essem 2023-11-29 00:32:23 -06:00
parent 6d33676fa4
commit fe16b6e41d
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
3 changed files with 3 additions and 3 deletions

View file

@ -111,7 +111,7 @@ export const paramDef = {
text: { type: "string", maxLength: MAX_NOTE_TEXT_LENGTH, nullable: true },
lang: {
type: "string",
enum: [null, ...Object.keys(langmap)],
enum: Object.keys(langmap),
nullable: true,
},
cw: { type: "string", nullable: true, maxLength: 100 },

View file

@ -171,7 +171,7 @@ export const paramDef = {
text: { type: "string", maxLength: MAX_NOTE_TEXT_LENGTH, nullable: true },
lang: {
type: "string",
enum: [null, ...Object.keys(langmap)],
enum: Object.keys(langmap),
nullable: true,
},
cw: { type: "string", nullable: true, maxLength: 250 },

View file

@ -992,7 +992,7 @@ async function post() {
channelId: props.channel ? props.channel.id : undefined,
poll: poll.value,
cw: useCw.value ? cw.value || "" : undefined,
lang: language.value,
lang: language.value ? language.value : undefined,
localOnly: localOnly.value,
visibility: visibility.value,
visibleUserIds: