mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-12-22 15:53:08 +02:00
fix: remove unnecessary code for updating questions
This commit is contained in:
parent
6593250945
commit
6e5ccd118d
@ -1,6 +1,5 @@
|
|||||||
const { logAdminEvent } = require('../../../../../../../lib/logging');
|
const { logAdminEvent } = require('../../../../../../../lib/logging');
|
||||||
const { updateStaffRoles } = require('../../../../../../../lib/users');
|
const { updateStaffRoles } = require('../../../../../../../lib/users');
|
||||||
const { randomUUID } = require('crypto');
|
|
||||||
const { ApplicationCommandPermissionType } = require('discord.js');
|
const { ApplicationCommandPermissionType } = require('discord.js');
|
||||||
|
|
||||||
module.exports.delete = fastify => ({
|
module.exports.delete = fastify => ({
|
||||||
@ -128,14 +127,11 @@ module.exports.patch = fastify => ({
|
|||||||
data: {
|
data: {
|
||||||
...data,
|
...data,
|
||||||
questions: {
|
questions: {
|
||||||
upsert: data.questions?.map(q => {
|
upsert: data.questions?.map(q => ({
|
||||||
if (!q.id) q.id = randomUUID();
|
create: q,
|
||||||
return {
|
update: q,
|
||||||
create: q,
|
where: { id: q.id },
|
||||||
update: q,
|
})),
|
||||||
where: { id: q.id },
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
select,
|
select,
|
||||||
|
Loading…
Reference in New Issue
Block a user