Skip to content

Commit a5138fb

Browse files
committed
address PR comments
1 parent d0fd912 commit a5138fb

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

packages/orm/src/client/zod/factory.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2240,10 +2240,16 @@ export class ZodSchemaFactory<
22402240

22412241
private canCreateModel(model: string) {
22422242
const modelDef = requireModel(this.schema, model);
2243+
if (modelDef.isDelegate) {
2244+
return false;
2245+
}
22432246
const hasRequiredUnsupportedFields = Object.values(modelDef.fields).some(
22442247
(fieldDef) => fieldDef.type === 'Unsupported' && !fieldDef.optional && !fieldHasDefaultValue(fieldDef),
22452248
);
2246-
return !hasRequiredUnsupportedFields;
2249+
if (hasRequiredUnsupportedFields) {
2250+
return false;
2251+
}
2252+
return true;
22472253
}
22482254

22492255
private isModelAllowed(targetModel: string): boolean {

0 commit comments

Comments
 (0)