Skip to content

Commit 466d740

Browse files
Add routing files missing in previous
1 parent 362fbea commit 466d740

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

appinfo/routes.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
['name' => 'googleAPI#getContactNumber', 'url' => '/contact-number', 'verb' => 'GET'],
2121
['name' => 'googleAPI#getPhotoNumber', 'url' => '/photo-number', 'verb' => 'GET'],
2222
['name' => 'googleAPI#importCalendar', 'url' => '/import-calendar', 'verb' => 'GET'],
23+
['name' => 'googleAPI#registerSyncCalendar', 'url' => '/sync-calendar', 'verb' => 'GET'],
2324
['name' => 'googleAPI#importContacts', 'url' => '/import-contacts', 'verb' => 'GET'],
2425
['name' => 'googleAPI#importPhotos', 'url' => '/import-photos', 'verb' => 'GET'],
2526
['name' => 'googleAPI#getImportPhotosInformation', 'url' => '/import-photos-info', 'verb' => 'GET'],

lib/Controller/GoogleAPIController.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,24 @@ public function importCalendar(string $calId, string $calName, ?string $color =
232232
return $response;
233233
}
234234

235+
236+
/**
237+
* @NoAdminRequired
238+
*
239+
* @param string $calId
240+
* @param string $calName
241+
* @param ?string $color
242+
* @return DataResponse
243+
*/
244+
public function registerSyncCalendar(string $calId, string $calName, ?string $color = null): DataResponse {
245+
if ($this->accessToken === '') {
246+
return new DataResponse('', 400);
247+
}
248+
$result = $this->googleCalendarAPIService->registerSyncCalendar($this->accessToken, $this->userId, $calId, $calName, $color);
249+
$response = new DataResponse($result, 200);
250+
return $response;
251+
}
252+
235253
/**
236254
* @NoAdminRequired
237255
*

0 commit comments

Comments
 (0)