From ed69a86489e9d29f0e55c1579f4f8c9bfbe395b9 Mon Sep 17 00:00:00 2001 From: Yannick Trinh Date: Wed, 27 Nov 2024 14:28:44 +0100 Subject: [PATCH] Feature GitHub:11199 (fix: now supports "primary" key as calendarId) --- Project/Sources/Classes/GoogleCalendar.4dm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Project/Sources/Classes/GoogleCalendar.4dm b/Project/Sources/Classes/GoogleCalendar.4dm index a71c868..d7a9081 100644 --- a/Project/Sources/Classes/GoogleCalendar.4dm +++ b/Project/Sources/Classes/GoogleCalendar.4dm @@ -28,12 +28,10 @@ Function getCalendar($inID : Text) : Object : (Type($inID)#Is text) Super._throwError(10; {which: "\"calendarId\""; function: "google.calendar.getCalendar"}) - : (Length(String($inID))=0) - Super._throwError(9; {which: "\"calendarId\""; function: "google.calendar.getCalendar"}) - Else - var $URL : Text:=Super._getURL()+"users/me/calendarList/"+cs.Tools.me.urlEncode($inID) + var $calendarID : Text:=(Length(String($inID))>0) ? $inID : "primary" + var $URL : Text:=Super._getURL()+"users/me/calendarList/"+cs.Tools.me.urlEncode($calendarID) var $headers : Object:={Accept: "application/json"} $response:=Super._sendRequestAndWaitResponse("GET"; $URL; $headers)