diff --git a/server/prisma/seed.d.ts b/server/prisma/seed.d.ts new file mode 100644 index 0000000..0986b1c --- /dev/null +++ b/server/prisma/seed.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=seed.d.ts.map \ No newline at end of file diff --git a/server/prisma/seed.d.ts.map b/server/prisma/seed.d.ts.map new file mode 100644 index 0000000..c1a0e0b --- /dev/null +++ b/server/prisma/seed.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"seed.d.ts","sourceRoot":"","sources":["seed.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/server/prisma/seed.js b/server/prisma/seed.js new file mode 100644 index 0000000..68c9546 --- /dev/null +++ b/server/prisma/seed.js @@ -0,0 +1,37 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const client_1 = require("@prisma/client"); +const prisma = new client_1.PrismaClient(); +async function main() { + const tagPasta = await prisma.tag.upsert({ where: { name: 'vegetar' }, update: {}, create: { name: 'vegetar' } }); + const user = await prisma.user.create({ + data: { name: 'Test Testesen', email: 'testesen@eksempel.no' }, + }); + await prisma.recipe.create({ + data: { + title: "Pesto Pasta", + description: "beste studentmiddagen vi har", + prepTimeMinutes: 15, + servings: 1, + category: 'middag', + status: 'PUBLISHED', + authorId: user.id, + tags: { connect: [{ id: tagPasta.id }] }, + ingredients: { + create: [ + { name: 'Pasta', amount: 200, unit: 'g', order: 1 }, + { name: 'Pesto', amount: 0.5, unit: 'stk', order: 2 }, + ], + }, + steps: { + create: [ + { order: 1, instruction: 'Kok opp vann og ha i pasta når det koker. følg koketid på pakka' }, + { order: 2, instruction: 'Ha ferdigkokt pasta i en bolle og ha over et halvt glass pesto, bland sammen' }, + { order: 3, instruction: 'Spis yummy pasta.' } + ], + }, + }, + }); +} +main().finally(() => prisma.$disconnect()); +//# sourceMappingURL=seed.js.map \ No newline at end of file diff --git a/server/prisma/seed.js.map b/server/prisma/seed.js.map new file mode 100644 index 0000000..657d5b6 --- /dev/null +++ b/server/prisma/seed.js.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iEAAiE,EAAC;oBAC3F,EAAE,KAAK,EAAE,CAAC,EAAE,WAAW,EAAE,8EAA8E,EAAC;oBACxG,EAAE,KAAK,EAAE,CAAC,EAAE,WAAW,EAAE,mBAAmB,EAAC;iBAChD;aACJ;SACJ;KACJ,CAAC,CAAC;AAEP,CAAC;AAED,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/server/src/index.d.ts b/server/src/index.d.ts new file mode 100644 index 0000000..e26a57a --- /dev/null +++ b/server/src/index.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/server/src/index.d.ts.map b/server/src/index.d.ts.map new file mode 100644 index 0000000..82335e7 --- /dev/null +++ b/server/src/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/server/src/index.js b/server/src/index.js new file mode 100644 index 0000000..aa219d8 --- /dev/null +++ b/server/src/index.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/server/src/index.js.map b/server/src/index.js.map new file mode 100644 index 0000000..87e53b9 --- /dev/null +++ b/server/src/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/server/tsconfig.json b/server/tsconfig.json index cec4a3a..af7d4ec 100644 --- a/server/tsconfig.json +++ b/server/tsconfig.json @@ -40,5 +40,7 @@ "noUncheckedSideEffectImports": true, "moduleDetection": "force", "skipLibCheck": true, - } + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "prisma"] }