mirror of
https://github.com/urosran/cally.git
synced 2025-11-26 08:24:55 +00:00
- Removed console.log
- Fixed an issue with title undefined when syncing events
This commit is contained in:
@ -1,5 +1,4 @@
|
|||||||
export async function fetchGoogleCalendarEvents(token, email, familyId, startDate, endDate) {
|
export async function fetchGoogleCalendarEvents(token, email, familyId, startDate, endDate) {
|
||||||
console.log(token);
|
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
`https://www.googleapis.com/calendar/v3/calendars/primary/events?single_events=true&time_min=${startDate}&time_max=${endDate}`,
|
`https://www.googleapis.com/calendar/v3/calendars/primary/events?single_events=true&time_min=${startDate}&time_max=${endDate}`,
|
||||||
{
|
{
|
||||||
@ -10,7 +9,6 @@ export async function fetchGoogleCalendarEvents(token, email, familyId, startDat
|
|||||||
);
|
);
|
||||||
|
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
console.log(data);
|
|
||||||
const googleEvents = [];
|
const googleEvents = [];
|
||||||
data.items?.forEach((item) => {
|
data.items?.forEach((item) => {
|
||||||
let isAllDay = false;
|
let isAllDay = false;
|
||||||
@ -41,7 +39,7 @@ export async function fetchGoogleCalendarEvents(token, email, familyId, startDat
|
|||||||
|
|
||||||
const googleEvent = {
|
const googleEvent = {
|
||||||
id: item.id,
|
id: item.id,
|
||||||
title: item.summary,
|
title: item.summary ?? "",
|
||||||
startDate: startDateTime,
|
startDate: startDateTime,
|
||||||
endDate: endDateTime,
|
endDate: endDateTime,
|
||||||
allDay: isAllDay,
|
allDay: isAllDay,
|
||||||
|
|||||||
Reference in New Issue
Block a user