Finally "fix" (hack) Prisma middleware bug

Middleware runs twice on question upsert?
This commit is contained in:
Isaac
2022-07-23 20:28:48 +01:00
parent e00ff4e831
commit 5f5ffca74c
9 changed files with 63 additions and 64 deletions

View File

@@ -78,8 +78,7 @@ module.exports.post = fastify => ({
data: {
guild: { connect: { id: guild.id } },
...data,
// questions: { createMany: { data: data.questions ?? [] } },
questions: { create: { data: data.questions ?? [] } }, // sqlite doesn't support createMany?
questions: { createMany: { data: data.questions ?? [] } },
},
});