@@ -44,7 +44,7 @@ export class InputValidator<Schema extends SchemaDef> {
4444 return this . validate < FindArgs < Schema , GetModels < Schema > , true > , Parameters < typeof this . makeFindSchema > [ 1 ] > (
4545 model ,
4646 'find' ,
47- { unique, collection : true } ,
47+ { unique } ,
4848 ( model , options ) => this . makeFindSchema ( model , options ) ,
4949 args ,
5050 ) ;
@@ -196,7 +196,7 @@ export class InputValidator<Schema extends SchemaDef> {
196196
197197 // #region Find
198198
199- private makeFindSchema ( model : string , options : { unique : boolean ; collection : boolean } ) {
199+ private makeFindSchema ( model : string , options : { unique : boolean } ) {
200200 const fields : Record < string , z . ZodSchema > = { } ;
201201 const where = this . makeWhereSchema ( model , options . unique ) ;
202202 if ( options . unique ) {
@@ -208,13 +208,13 @@ export class InputValidator<Schema extends SchemaDef> {
208208 fields [ 'select' ] = this . makeSelectSchema ( model ) . optional ( ) ;
209209 fields [ 'include' ] = this . makeIncludeSchema ( model ) . optional ( ) ;
210210 fields [ 'omit' ] = this . makeOmitSchema ( model ) . optional ( ) ;
211- fields [ 'distinct' ] = this . makeDistinctSchema ( model ) . optional ( ) ;
212- fields [ 'cursor' ] = this . makeCursorSchema ( model ) . optional ( ) ;
213211
214- if ( options . collection ) {
212+ if ( ! options . unique ) {
215213 fields [ 'skip' ] = this . makeSkipSchema ( ) . optional ( ) ;
216214 fields [ 'take' ] = this . makeTakeSchema ( ) . optional ( ) ;
217215 fields [ 'orderBy' ] = this . orArray ( this . makeOrderBySchema ( model , true , false ) , true ) . optional ( ) ;
216+ fields [ 'cursor' ] = this . makeCursorSchema ( model ) . optional ( ) ;
217+ fields [ 'distinct' ] = this . makeDistinctSchema ( model ) . optional ( ) ;
218218 }
219219
220220 let result : ZodType = z . strictObject ( fields ) ;
0 commit comments