2
2
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
3
3
exports . formatAction = void 0 ;
4
4
const formatAction = ( message , hasValues , customLabel ) => {
5
- var _a , _b , _c ;
5
+ var _a , _b , _c , _d , _e ;
6
6
// do not overwrite 'quelle'
7
7
// do not delete first and lastname if they exist in the old record but not it the message
8
8
const global = {
@@ -12,11 +12,11 @@ const formatAction = (message, hasValues, customLabel) => {
12
12
"phone" : ( ( _a = message . contact ) === null || _a === void 0 ? void 0 : _a . phone ) || "" ,
13
13
"double_opt_in" : "yes" ,
14
14
"street" : message . contact . street || "" ,
15
- "zip" : message . contact . postcode || "" ,
15
+ "zip" : ( ( _b = message . contact ) === null || _b === void 0 ? void 0 : _b . postcode ) ? ( _c = message . contact ) === null || _c === void 0 ? void 0 : _c . postcode . toString ( ) : ( hasValues === null || hasValues === void 0 ? void 0 : hasValues . zip ) || "" ,
16
16
"lastname" : ( hasValues === null || hasValues === void 0 ? void 0 : hasValues . lastname ) && ! message . contact . lastName ? hasValues . lastname : message . contact . lastName || "" ,
17
17
"firstname" : message . contact . firstName ,
18
18
"country" : message . contact . country || message . contact . area || "" ,
19
- "company" : ( hasValues === null || hasValues === void 0 ? void 0 : hasValues . company ) && ! message . contact . company ? hasValues . company : ( ( _c = ( _b = message . action . customFields ) === null || _b === void 0 ? void 0 : _b . organisation ) === null || _c === void 0 ? void 0 : _c . toString ( ) ) || "" ,
19
+ "company" : ( hasValues === null || hasValues === void 0 ? void 0 : hasValues . company ) && ! message . contact . company ? hasValues . company : ( ( _e = ( _d = message . action . customFields ) === null || _d === void 0 ? void 0 : _d . organisation ) === null || _e === void 0 ? void 0 : _e . toString ( ) ) || "" ,
20
20
"city" : message . contact . locality || "" ,
21
21
"last_changed" : message . privacy . emailStatusChanged || "" ,
22
22
// each campaign should have custom field with the name date (6 figures) and campaign title
0 commit comments