Add DELETE guild settings route

For completely resetting a guild
This commit is contained in:
Isaac
2022-05-07 21:28:33 +01:00
parent 41ccd778c6
commit 145514a86b
2 changed files with 16 additions and 3 deletions

View File

@@ -1,3 +1,16 @@
module.exports.delete = fastify => ({
handler: async (req, res) => {
/** @type {import('../../../../../client')} */
const client = res.context.config.client;
await client.prisma.guild.delete({ where: { id: req.params.guild } });
const settings = await client.prisma.guild.create({ data: { id: req.params.guild } });
res.send(settings);
},
onRequest: [fastify.authenticate, fastify.isAdmin],
});
module.exports.get = fastify => ({
handler: async (req, res) => {
/** @type {import('../../../../../client')} */