mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2025-02-23 18:51:29 +02:00
fix(scripts): remove categoryId
when importing questions
This commit is contained in:
parent
c8eb0b9215
commit
b2d6413221
@ -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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user