Allow multiple attendees in one field in Google Calendar

This commit is contained in:
Jan Oberhauser 2020-12-01 10:13:48 +01:00
parent e428ccffba
commit f79cb7e989
2 changed files with 10 additions and 12 deletions

View file

@ -166,7 +166,7 @@ export const eventFields = [
multipleValueButtonText: 'Add Attendee',
},
default: '',
description: 'The attendees of the event',
description: 'The attendees of the event. Multiple ones can be separated by comma.',
},
{
displayName: 'Color',
@ -810,7 +810,7 @@ export const eventFields = [
multipleValueButtonText: 'Add Attendee',
},
default: '',
description: 'The attendees of the event',
description: 'The attendees of the event. Multiple ones can be separated by comma.',
},
{
displayName: 'Color',

View file

@ -259,11 +259,10 @@ export class GoogleCalendar implements INodeType {
},
};
if (additionalFields.attendees) {
body.attendees = (additionalFields.attendees as string[]).map(
attendee => {
return { email: attendee };
},
);
body.attendees = [];
(additionalFields.attendees as string[]).forEach(attendee => {
body.attendees!.push.apply(body.attendees, attendee.split(',').map(a => a.trim()).map(email => ({ email })));
});
}
if (additionalFields.color) {
body.colorId = additionalFields.color as string;
@ -504,11 +503,10 @@ export class GoogleCalendar implements INodeType {
};
}
if (updateFields.attendees) {
body.attendees = (updateFields.attendees as string[]).map(
attendee => {
return { email: attendee };
},
);
body.attendees = [];
(updateFields.attendees as string[]).forEach(attendee => {
body.attendees!.push.apply(body.attendees, attendee.split(',').map(a => a.trim()).map(email => ({ email })));
});
}
if (updateFields.color) {
body.colorId = updateFields.color as string;