Skip to content

Commit

Permalink
fix: remove unnecessary code for updating questions
Browse files Browse the repository at this point in the history
  • Loading branch information
eartharoid committed Jun 18, 2023
1 parent 6593250 commit 6e5ccd1
Showing 1 changed file with 5 additions and 9 deletions.
@@ -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 => ({
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 6e5ccd1

Please sign in to comment.