Closed nicmart-dev closed 1 month ago
Best to rely on n8n business logic, but otherwise here is a starter code:
const checkAvailability = async (accessToken, calendarId, start, end) => {
const calendar = google.calendar({ version: 'v3', auth: accessToken });
const events = await calendar.events.list({
calendarId: calendarId,
timeMin: start,
timeMax: end,
singleEvents: true,
orderBy: 'startTime',
});
return events.data.items;
};
Will do this with #5 using n8n but if issues, may fallback to not using n8n for this.
Query the selected calendars to check for available time slots, using calendar selected in #18