fix: update categories cache when guild settings are changed

This commit is contained in:
Isaac 2023-03-17 21:42:47 +00:00
parent c7a1b05049
commit 8b692fa5e2
No known key found for this signature in database
GPG Key ID: 0DE40AE37BBA5C33

View File

@ -54,9 +54,16 @@ module.exports.patch = fastify => ({
const original = await client.prisma.guild.findUnique({ where: { id } });
const settings = await client.prisma.guild.update({
data: data,
include: { categories: { select: { id: true } } },
where: { id },
});
// Update cached categories, which include guild settings
for (const { id } of settings.categories) await client.tickets.getCategory(id, true);
// don't log the categories
delete settings.categories;
logAdminEvent(client, {
action: 'update',
diff: {