diff --git a/packages/frontend/src/components/grid/MkDataCell.vue b/packages/frontend/src/components/grid/MkDataCell.vue index 40fa2b4812..6c0d087b42 100644 --- a/packages/frontend/src/components/grid/MkDataCell.vue +++ b/packages/frontend/src/components/grid/MkDataCell.vue @@ -50,23 +50,12 @@ diff --git a/packages/frontend/src/pages/admin/custom-emojis-grid.register.vue b/packages/frontend/src/pages/admin/custom-emojis-grid.register.vue index 9eb75ac45b..5c2fda4f35 100644 --- a/packages/frontend/src/pages/admin/custom-emojis-grid.register.vue +++ b/packages/frontend/src/pages/admin/custom-emojis-grid.register.vue @@ -154,17 +154,20 @@ async function onRegistryClicked() { const items = new Map(gridItems.value.map(it => [`${it.fileId}|${it.name}`, it])); const upload = async (): Promise => { + const emptyStrToNull = (value: string) => value === '' ? null : value; + const emptyStrToEmptyArray = (value: string) => value === '' ? [] : value.split(',').map(it => it.trim()); + const result = Array.of(); for (const [key, item] of [...items.entries()].slice(0, MAXIMUM_EMOJI_COUNT)) { try { await misskeyApi('admin/emoji/add', { name: item.name, - category: item.category, - aliases: item.aliases.split(',').map(it => it.trim()), - license: item.license, + category: emptyStrToNull(item.category), + aliases: emptyStrToEmptyArray(item.aliases), + license: emptyStrToNull(item.license), isSensitive: item.isSensitive, localOnly: item.localOnly, - roleIdsThatCanBeUsedThisEmojiAsReaction: item.roleIdsThatCanBeUsedThisEmojiAsReaction.split(',').map(it => it.trim()), + roleIdsThatCanBeUsedThisEmojiAsReaction: emptyStrToEmptyArray(item.roleIdsThatCanBeUsedThisEmojiAsReaction), fileId: item.fileId!, }); result.push({ key, item, success: true, err: undefined });