fix: remove unnecessary code for updating questions

This commit is contained in:
Isaac 2023-06-18 23:58:30 +01:00
parent 6593250945
commit 6e5ccd118d
No known key found for this signature in database
GPG Key ID: 0DE40AE37BBA5C33

View File

@ -1,6 +1,5 @@
const { logAdminEvent } = require('../../../../../../../lib/logging');
const { updateStaffRoles } = require('../../../../../../../lib/users');
const { randomUUID } = require('crypto');
const { ApplicationCommandPermissionType } = require('discord.js');
module.exports.delete = fastify => ({
@ -128,14 +127,11 @@ module.exports.patch = fastify => ({
data: {
...data,
questions: {
upsert: data.questions?.map(q => {
if (!q.id) q.id = randomUUID();
return {
create: q,
update: q,
where: { id: q.id },
};
}),
upsert: data.questions?.map(q => ({
create: q,
update: q,
where: { id: q.id },
})),
},
},
select,