Skip to content

Commit

Permalink
fixed build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
MistahSanta committed Sep 2, 2024
1 parent 1469521 commit 8344def
Showing 1 changed file with 24 additions and 20 deletions.
44 changes: 24 additions & 20 deletions src/server/api/routers/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,31 @@ export const calendarRouter = createTRPCRouter({

const calendar = google.calendar({ version: 'v3', auth: oauth2Client });

try {
const response = calendar.events.insert({
calendarId: 'primary',
resource: {
summary: eventName,
description: description,
location: location,
start: {
dateTime: startTime
},
end: {
dateTime: endTime
},
}
})

const response = calendar.events.insert({
calendarId: 'primary',
requestBody: {
summary: eventName,
description: description,
location: location,
start: {
dateTime: startTime.toDateString()
},
end: {
dateTime: endTime.toDateString()
},
}
}, (error, response) => {
if (error) {
console.error("Error adding event:", error);
throw error;
} else {
console.log("Event added successfully:", response);
}
})

return response

return response
} catch( error) {
console.error("Recieved an error when trying to add event to calendar: ", error)
throw error
}



Expand Down

0 comments on commit 8344def

Please sign in to comment.