@@ -43,18 +43,7 @@ function processAction(msg, cfg) {
43
43
function emitData ( data ) {
44
44
const id = data . id ;
45
45
console . log ( 'Successfully created event with ID=' + id ) ;
46
- console . log ( 'Emitting data ...' ) ;
47
- console . log ( '---DATA---' ) ;
48
- console . log ( '%j' , data ) ;
49
- console . log ( '---MSG---' ) ;
50
- console . log ( '%j' , messages . newMessageWithBody ( data ) ) ;
51
-
52
- //const messageBody = _.cloneDeep(data);
53
- const messageBody = _ . pick ( data , [
54
- 'id' , 'createdDateTime' , 'lastModifiedDateTime' , 'originalStartTimeZone' ,
55
- 'originalEndTimeZone' , 'iCalUId' , 'reminderMinutesBeforeStart' , 'subject' ,
56
- 'importance' , 'sensitivity' , 'isAllDay' , 'isCancelled' , 'isOrganizer' , 'showAs' ,
57
- 'webLink' , 'body' , 'start' , 'end' , 'location' , 'organizer' ] ) ;
46
+ const messageBody = _ . omitBy ( data , ( value , key ) => key . startsWith ( '@odata.' ) ) ;
58
47
messageBody . calendarId = cfg . calendarId ;
59
48
console . log ( 'Emitting data ...' ) ;
60
49
self . emit ( 'data' , messages . newMessageWithBody ( messageBody ) ) ;
0 commit comments