Skip to content

Commit

Permalink
fixed bug with duplicate import on include schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishoermann committed Feb 1, 2023
1 parent 8578435 commit 39187b2
Show file tree
Hide file tree
Showing 3 changed files with 168 additions and 188 deletions.
2 changes: 1 addition & 1 deletion packages/generator/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zod-prisma-types",
"version": "2.0.4",
"version": "2.0.5",
"description": "Generates zod schemas from Prisma models with advanced validation",
"author": "Chris Hörmann",
"license": "MIT",
Expand Down
20 changes: 0 additions & 20 deletions packages/generator/src/functions/contentWriters/writeInclude.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,6 @@ export const writeInclude = (
writeImport('{ z }', 'zod');
writeImport('{ type Prisma }', prismaClientPath);
writeImportSet(model.includeImports);

// model.fields.forEach((field) => {
// // when using mongodb, the `include` type is created but not filled with any fields
// // So no need to import anything
// // if (dmmf.generatorConfig.isMongoDb) return;

// if (field.writeIncludeFindManyField) {
// return writeImport(
// `{ ${field.outputType.type}FindManyArgsSchema }`,
// `../${outputTypePath}/${field.outputType.type}FindManyArgsSchema`,
// );
// }

// if (field.writeIncludeField) {
// return writeImport(
// `{ ${field.outputType.type}ArgsSchema }`,
// `../${outputTypePath}/${field.outputType.type}ArgsSchema`,
// );
// }
// });
}

writer
Expand Down

0 comments on commit 39187b2

Please sign in to comment.