File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed 
runtime/src/enhancements/node/policy Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -1579,12 +1579,15 @@ export class PolicyProxyHandler<DbClient extends DbClientContract> implements Pr
15791579                    if  ( this . shouldLogQuery )  { 
15801580                        this . logger . info ( 
15811581                            `[policy] \`findMany\` ${ this . model } ${ formatObject ( {  
1582-                                 where : args . where ,  
1582+                                 where : args . where   ??   { } ,  
15831583                                select : candidateSelect ,  
15841584                            } ) }  `
15851585                        ) ; 
15861586                    } 
1587-                     const  candidates  =  await  tx [ this . model ] . findMany ( {  where : args . where ,  select : candidateSelect  } ) ; 
1587+                     const  candidates  =  await  tx [ this . model ] . findMany ( { 
1588+                         where : args . where  ??  { } , 
1589+                         select : candidateSelect , 
1590+                     } ) ; 
15881591
15891592                    // build a ID filter based on id values filtered by the additional checker 
15901593                    const  {  idFilter }  =  this . buildIdFilterWithEntityChecker ( candidates ,  entityChecker . func ) ; 
Original file line number Diff line number Diff line change @@ -678,7 +678,7 @@ class RequestHandler extends APIHandlerBase {
678678            args . take  =  limit ; 
679679            const  [ entities ,  count ]  =  await  Promise . all ( [ 
680680                prisma [ type ] . findMany ( args ) , 
681-                 prisma [ type ] . count ( {  where : args . where  } ) , 
681+                 prisma [ type ] . count ( {  where : args . where  ??   { }   } ) , 
682682            ] ) ; 
683683            const  total  =  count  as  number ; 
684684
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments