mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-11-17 17:23:08 +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 original = await client.prisma.guild.findUnique({ where: { id } });
|
||||||
const settings = await client.prisma.guild.update({
|
const settings = await client.prisma.guild.update({
|
||||||
data: data,
|
data: data,
|
||||||
|
include: { categories: { select: { id: true } } },
|
||||||
where: { id },
|
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, {
|
logAdminEvent(client, {
|
||||||
action: 'update',
|
action: 'update',
|
||||||
diff: {
|
diff: {
|
||||||
|
Loading…
Reference in New Issue
Block a user