Skip to content

Commit 5d75fe3

Browse files
committed
update
1 parent ec173a5 commit 5d75fe3

File tree

1 file changed

+6
-2
lines changed
  • packages/schema/src/plugins/enhancer/enhance

1 file changed

+6
-2
lines changed

packages/schema/src/plugins/enhancer/enhance/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,9 +542,13 @@ export function enhance(prisma: any, context?: EnhancementContext<${authTypePara
542542
// remove discriminator field from the create/update input because discriminator cannot be set directly
543543
const typeName = typeAlias.getName();
544544

545-
const concreteModelNames = delegateInfo.map(([_, concretes]) => concretes.flatMap((c) => c.name));
545+
const delegateModelNames = delegateInfo.map(([delegate]) => delegate.name);
546+
const concreteModelNames = delegateInfo
547+
.map(([_, concretes]) => concretes.flatMap((c) => c.name))
548+
.flatMap((name) => name);
549+
const allModelNames = [...new Set([...delegateModelNames, ...concreteModelNames])];
546550
const concreteCreateUpdateInputRegex = new RegExp(
547-
`^(${concreteModelNames.join('|')})(Unchecked)?(Create|Update).*Input$`
551+
`^(${allModelNames.join('|')})(Unchecked)?(Create|Update).*Input$`
548552
);
549553

550554
const match = typeName.match(concreteCreateUpdateInputRegex);

0 commit comments

Comments
 (0)