Fix null coalescing in /admin/emoji/update

This commit is contained in:
HellhoundSoftware 2025-01-13 15:36:07 -05:00
parent e2339ca32e
commit bf9a166462
No known key found for this signature in database

View file

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