Detach Calendar
This API endpoint is triggered by the extension interface when a attached Google calendar is detached from the Scrims calendar.
Endpoint
POST /google/calendars/detach HTTP/1.1
Host: api.atomcal.com/api/v2
Content-Type: application/x-www-form-urlencoded
Triggered by: Extension interface
Authentication: security.verifyAuthToken
Query: req.query.calendar_id
Upon detachment it also deletes the saved Google events.
Example Responses
200 (successful operation)
res.status(200).send({ calendars });
400 (bad response)
Boom.badRequest(errorMessage)
Implementation details
Detach Google Calendar
Using the Google calendar id passed as query param by the extension interface delete the calendar from local database and delete all saved Google events in the local database for this calendar.
Return all Google calendars
Finally read all the google calendars using the member id obtained from the token authenticator service and return all saved Google calendars.
Edge cases
N/A