fix(scripts): remove categoryId when importing questions

This commit is contained in:
Isaac 2025-01-16 21:06:44 +00:00
parent c8eb0b9215
commit b2d6413221
No known key found for this signature in database
GPG Key ID: 0DE40AE37BBA5C33

View File

@ -85,7 +85,12 @@ for (const category of dump.categories) {
const original_id = category.id; const original_id = category.id;
delete category.id; delete category.id;
delete category.guildId; 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({ const { id: new_id } = await prisma.category.create({
data: { data: {
...category, ...category,