@@ -156,6 +156,7 @@ export async function processGeneric({ document, name, data, contextUser }) {
156
156
success : true ,
157
157
processData : { } ,
158
158
errors : [ ] ,
159
+ changes : { } ,
159
160
} ;
160
161
161
162
const createRequest = {
@@ -195,6 +196,7 @@ export async function processCampaignTarget({ data, contextUser }) {
195
196
success : true ,
196
197
processData : { } ,
197
198
errors : [ ] ,
199
+ changes : { } ,
198
200
} ;
199
201
200
202
if ( MetaObject . Namespace . skipCampaignTargetForActiveOpportunities === true ) {
@@ -260,6 +262,7 @@ export async function processOpportunity({ data, contextUser }) {
260
262
success : true ,
261
263
processData : { } ,
262
264
errors : [ ] ,
265
+ changes : { } ,
263
266
} ;
264
267
265
268
let record = await find ( {
@@ -594,6 +597,7 @@ export async function processMessage({ data, contextUser }) {
594
597
success : true ,
595
598
processData : { } ,
596
599
errors : [ ] ,
600
+ changes : { }
597
601
} ;
598
602
599
603
const campaign = await findCampaign ( data . campaign , contextUser ) ;
@@ -642,6 +646,7 @@ export async function processActivity({ data, contextUser }) {
642
646
success : true ,
643
647
processData : { } ,
644
648
errors : [ ] ,
649
+ changes : { } ,
645
650
} ;
646
651
647
652
if ( has ( data , 'campaign.code' ) && ! has ( data , 'campaign._id' ) ) {
@@ -759,6 +764,7 @@ export async function processContact({ data, options, contextUser }) {
759
764
success : true ,
760
765
processData : { } ,
761
766
errors : [ ] ,
767
+ changes : { } ,
762
768
} ;
763
769
764
770
let codeSent = false ;
@@ -767,7 +773,7 @@ export async function processContact({ data, options, contextUser }) {
767
773
}
768
774
let phoneSent = [ ] ;
769
775
770
- if ( data . phone && ! isEmpty ( data . phone ) ) {
776
+ if ( data . phone && ( ! isEmpty ( data . phone ) || data . phone > 0 ) ) {
771
777
phoneSent = phoneSent . concat ( data . phone ) ;
772
778
}
773
779
@@ -779,7 +785,7 @@ export async function processContact({ data, options, contextUser }) {
779
785
// validate if phone or email was passed
780
786
if ( codeSent === false && emailSent . length === 0 && phoneSent . length === 0 ) {
781
787
response . success = false ;
782
- response . errors = [ { meaage : 'É obrigatório o preenchimento de ao menos um dos seguintes campos: code, email e telefone.' } ] ;
788
+ response . errors = [ { message : 'É obrigatório o preenchimento de ao menos um dos seguintes campos: code, email e telefone.' } ] ;
783
789
delete response . processData ;
784
790
return response ;
785
791
}
@@ -1245,8 +1251,6 @@ export async function processContact({ data, options, contextUser }) {
1245
1251
delete contactData . referrerURL ;
1246
1252
}
1247
1253
1248
- let operationPerformed = 'created' ;
1249
-
1250
1254
// creates a contact if not found one
1251
1255
if ( contact == null ) {
1252
1256
const createRequest = {
0 commit comments