Skip to content

Commit

Permalink
fix(scripts): remove categoryId when importing questions
Browse files Browse the repository at this point in the history
  • Loading branch information
eartharoid committed Jan 16, 2025
1 parent c8eb0b9 commit b2d6413
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/import.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@ for (const category of dump.categories) {
const original_id = category.id;
delete category.id;
delete category.guildId;
category.questions = { create: category.questions };
category.questions = {
create: category.questions.map(question => {
delete question.categoryId;
return question;
}),
};
const { id: new_id } = await prisma.category.create({
data: {
...category,
Expand Down

0 comments on commit b2d6413

Please sign in to comment.