From 5dc0d0b2e860d726bc163f12d671733ab9c44825 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 13 Oct 2020 17:28:35 +0200 Subject: [PATCH] protonmail: update calendar endpoints They are now under the /calendar/v1 prefix. --- protonmail/calendar.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/protonmail/calendar.go b/protonmail/calendar.go index 62a3999..0dabd87 100644 --- a/protonmail/calendar.go +++ b/protonmail/calendar.go @@ -6,6 +6,8 @@ import ( "strconv" ) +const calendarPath = "/calendar/v1" + type CalendarFlags int type Calendar struct { @@ -49,7 +51,7 @@ func (c *Client) ListCalendars(page, pageSize int) ([]*Calendar, error) { v.Set("PageSize", strconv.Itoa(pageSize)) } - req, err := c.newRequest(http.MethodGet, "/calendars?"+v.Encode(), nil) + req, err := c.newRequest(http.MethodGet, calendarPath+"?"+v.Encode(), nil) if err != nil { return nil, err } @@ -81,7 +83,7 @@ func (c *Client) ListCalendarEvents(calendarID string, filter *CalendarEventFilt v.Set("PageSize", strconv.Itoa(filter.PageSize)) } - req, err := c.newRequest(http.MethodGet, "/calendars/"+calendarID+"/events?"+v.Encode(), nil) + req, err := c.newRequest(http.MethodGet, calendarPath+"/"+calendarID+"/events?"+v.Encode(), nil) if err != nil { return nil, err }