File tree Expand file tree Collapse file tree 3 files changed +4
-5
lines changed Expand file tree Collapse file tree 3 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 1- import  {  ForbiddenError  }  from  '@redwoodjs/graphql-server' ; 
1+ import  {  ForbiddenError ,   ValidationError  }  from  '@redwoodjs/graphql-server' ; 
22import  { 
33    CrudFailureReason , 
44    EnhancementOptions , 
55    PrismaErrorCode , 
6-     ValidationError , 
76    enhance , 
87    isPrismaClientKnownRequestError , 
98    type  AuthUser , 
@@ -47,7 +46,7 @@ export function useZenStack<PrismaClient extends object>(
4746
4847// Transforms ZenStack errors into appropriate RedwoodJS errors 
4948function  transformError ( error : unknown )  { 
50-     if  ( isPrismaClientKnownRequestError ( error )  &&  error . code  ===  PrismaErrorCode . CONSTRAINED_FAILED )  { 
49+     if  ( isPrismaClientKnownRequestError ( error )  &&  error . code  ===  PrismaErrorCode . CONSTRAINT_FAILED )  { 
5150        if  ( 
5251            error . meta ?. reason  ===  CrudFailureReason . ACCESS_POLICY_VIOLATION  || 
5352            error . meta ?. reason  ===  CrudFailureReason . RESULT_NOT_READABLE 
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ export enum PrismaErrorCode {
4040    /** 
4141     * A constraint failed on the database 
4242     */ 
43-     CONSTRAINED_FAILED  =  'P2004' , 
43+     CONSTRAINT_FAILED  =  'P2004' , 
4444
4545    /** 
4646     * The required connected records were not found 
Original file line number Diff line number Diff line change @@ -1215,7 +1215,7 @@ export class PolicyUtil extends QueryUtils {
12151215        reason ?: CrudFailureReason , 
12161216        zodErrors ?: ZodError 
12171217    )  { 
1218-         const  args : any  =  {  clientVersion : getVersion ( ) ,  code : PrismaErrorCode . CONSTRAINED_FAILED ,  meta : { }  } ; 
1218+         const  args : any  =  {  clientVersion : getVersion ( ) ,  code : PrismaErrorCode . CONSTRAINT_FAILED ,  meta : { }  } ; 
12191219        if  ( reason )  { 
12201220            args . meta . reason  =  reason ; 
12211221        } 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments