File tree Expand file tree Collapse file tree 1 file changed +9
-21
lines changed 
components/snipcart/actions/create-discount Expand file tree Collapse file tree 1 file changed +9
-21
lines changed Original file line number Diff line number Diff line change @@ -67,35 +67,23 @@ export default {
6767      hidden : true , 
6868    } , 
6969  } , 
70-   async  additionalProps ( )  { 
70+   async  additionalProps ( existingProps )  { 
7171    const  props  =  { } ; 
7272    if  ( this . trigger  ===  "Code" )  { 
73-       props . code  =  { 
74-         type : "string" , 
75-         label : "Code" , 
76-         description : "Code for the discount" , 
77-       } ; 
73+       existingProps . code . hidden  =  false ; 
74+       existingProps . code . disabled : false , 
7875    } 
7976    if  ( this . trigger  ===  "Total" )  { 
80-       props . totalToReach  =  { 
81-         type : "string" , 
82-         label : "Total to Reach" , 
83-         description : "Minimum amount required to activate the discount" , 
84-       } ; 
77+       existingProps . totalToReach . hidden  =  false ; 
78+       existingProps . totalToReach . disabled  =  false ; 
8579    } 
8680    if  ( this . type  ===  "FixedAmount" )  { 
87-       props . amount  =  { 
88-         type : "string" , 
89-         label : "Amount" , 
90-         description : "Discount amount. Required when discount type is `FixedAmount`" , 
91-       } ; 
81+       existingProps . amount . hidden  =  false ; 
82+       existingProps . amount . disabled  =  false ; 
9283    } 
9384    if  ( this . type  ===  "Rate" )  { 
94-       props . rate  =  { 
95-         type : "string" , 
96-         label : "Rate" , 
97-         description : "Discount percentage, i.e.: `10`. Required when discount type is `Rate`" , 
98-       } ; 
85+       existingProps . rate . hidden  =  false ; 
86+       existingProps . rate . disabled  =  false ; 
9987    } 
10088    return  props ; 
10189  } , 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments