Fix #436: Saving emojis per batch, to avoid hitting max payload limit.

This commit is contained in:
John Livingston
2024-06-20 11:14:00 +02:00
parent 01b93c1887
commit 83dd3130a1
5 changed files with 74 additions and 7 deletions

View File

@ -168,7 +168,16 @@ async function initConfigurationApiRouter (options: RegisterServerOptions, route
await emojis.saveChannelDefinition(channelInfos.id, emojisDefinitionSanitized, bufferInfos)
res.sendStatus(200)
// Reloading data, to send them back to front:
const channelEmojis =
(await emojis.channelCustomEmojisDefinition(channelInfos.id)) ??
emojis.emptyChannelDefinition()
const result: ChannelEmojisConfiguration = {
channel: channelInfos,
emojis: channelEmojis
}
res.status(200)
res.json(result)
} catch (err) {
logger.error(err)
res.sendStatus(500)