mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-27 14:24:38 +00:00
Fix null coalescing in /admin/emoji/update
This commit is contained in:
parent
e2339ca32e
commit
bf9a166462
1 changed files with 5 additions and 1 deletions
|
@ -96,10 +96,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
emojiId = emoji.id;
|
||||
}
|
||||
|
||||
let categoryNfc: string|null|undefined = ps.category?.normalize('NFC');
|
||||
if (ps.category === null) // stop ?. from turning a null into an undefined
|
||||
categoryNfc = null;
|
||||
|
||||
await this.customEmojiService.update(emojiId, {
|
||||
driveFile,
|
||||
name: nameNfc,
|
||||
category: ps.category?.normalize('NFC'),
|
||||
category: categoryNfc,
|
||||
aliases: ps.aliases?.map(a => a.normalize('NFC')),
|
||||
license: ps.license,
|
||||
isSensitive: ps.isSensitive,
|
||||
|
|
Loading…
Add table
Reference in a new issue