mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-12-23 00:03:09 +02:00
fix: update categories cache when guild settings are changed
This commit is contained in:
parent
c7a1b05049
commit
8b692fa5e2
@ -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: {
|
||||
|
Loading…
Reference in New Issue
Block a user