File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed
components/close/actions/update-lead Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -64,24 +64,20 @@ export default {
6464 } ,
6565 } ,
6666 async run ( { $ } ) {
67+ const data = { } ;
68+ if ( this . name ) data . name = this . name ;
69+ if ( this . url ) data . url = this . url ;
70+ if ( this . statusId ) data . status_id = this . statusId ;
71+ if ( this . contacts ) data . contacts = utils . parseArray ( this . contacts ) ;
72+ if ( this . addresses ) data . addresses = utils . parseArray ( this . addresses ) ;
6773 const moreFields = { } ;
6874 for ( let key in this . moreFields ) {
6975 moreFields [ key ] = utils . parseObject ( this . moreFields [ key ] ) ;
7076 }
7177 const response = await this . close . updateLead ( {
7278 leadId : this . lead ,
7379 data : {
74- const response = await this . close . updateLead ( {
75- leadId : this . lead ,
76- data : {
77- ...( this . name && { name : this . name } ) ,
78- ...( this . url && { url : this . url } ) ,
79- ...( this . statusId && { status_id : this . statusId } ) ,
80- ...( this . contacts && { contacts : utils . parseArray ( this . contacts ) } ) ,
81- ...( this . addresses && { addresses : utils . parseArray ( this . addresses ) } ) ,
82- ...moreFields ,
83- } ,
84- } ) ;
80+ ...data ,
8581 ...moreFields ,
8682 } ,
8783 } ) ;
You can’t perform that action at this time.
0 commit comments