File tree Expand file tree Collapse file tree 2 files changed +30
-3
lines changed
packages/schema/src/plugins/zod Expand file tree Collapse file tree 2 files changed +30
-3
lines changed Original file line number Diff line number Diff line change @@ -464,9 +464,6 @@ export const ${upperCaseFirst(model.name)}PrismaCreateSchema = ${prismaCreateSch
464464 . join ( ',\n' ) }
465465 })` ;
466466 prismaUpdateSchema = this . makePartial ( prismaUpdateSchema ) ;
467- if ( refineFuncName ) {
468- prismaUpdateSchema = `${ refineFuncName } (${ prismaUpdateSchema } )` ;
469- }
470467 writer . writeLine (
471468 `
472469/**
Original file line number Diff line number Diff line change 1+ import { loadSchema } from '@zenstackhq/testtools' ;
2+
3+ describe ( 'issue 1563' , ( ) => {
4+ it ( 'regression' , async ( ) => {
5+ const { enhance } = await loadSchema (
6+ `
7+ model ModelA {
8+ id String @id @default(cuid())
9+ ref ModelB[]
10+ }
11+
12+ model ModelB {
13+ id String @id @default(cuid())
14+ ref ModelA? @relation(fields: [refId], references: [id])
15+ refId String?
16+
17+ @@validate(refId != null, "refId must be set")
18+ }
19+ ` ,
20+ { enhancements : [ 'validation' ] }
21+ ) ;
22+
23+ const db = enhance ( ) ;
24+
25+ const a = await db . modelA . create ( { data : { } } ) ;
26+ const b = await db . modelB . create ( { data : { refId : a . id } } ) ;
27+
28+ await expect ( db . modelB . update ( { where : { id : b . id } , data : { refId : a . id } } ) ) . toResolveTruthy ( ) ;
29+ } ) ;
30+ } ) ;
You can’t perform that action at this time.
0 commit comments