diff --git a/pub/api/classes/API_office_stompjes.php b/pub/api/classes/API_office_stompjes.php index b38b68d..7cdbe12 100644 --- a/pub/api/classes/API_office_stompjes.php +++ b/pub/api/classes/API_office_stompjes.php @@ -29,4 +29,13 @@ class API_office_stompjes extends API $this->apiOutput(200, ['success' => 'Stomp removed.']); } + + public function getStomp() + { + list($query, $types, $params) = $this->buildDynamicQuery('office_stompjes'); + + $items = $this->generalGetFunction($query, $types, $params, false, 'Stompjes'); + + return ($items); + } } \ No newline at end of file diff --git a/pub/api/v1/office/stompjes/index.php b/pub/api/v1/office/stompjes/index.php index 1dee2f9..08c9d76 100644 --- a/pub/api/v1/office/stompjes/index.php +++ b/pub/api/v1/office/stompjes/index.php @@ -12,9 +12,15 @@ if (!$GLOBALS['modules_enabled']['office']) { echo '405 Not Allowed'; exit; } +if ($API_office_stompjes->request_method === 'GET') { + $API_office_stompjes->checkPermissions('office-stompjes', 'RO'); -if ($API_office_stompjes->request_method === 'POST') { - $API_office_stompjes->checkPermissions('ofice-stompjes-canstomp', 'RW'); + $stompjes = $API_office_stompjes->getStomp(); + + $API_office_stompjes->apiOutput($code = 200, ['success' => $stompjes]); + +} elseif ($API_office_stompjes->request_method === 'POST') { + $API_office_stompjes->checkPermissions('office-stompjes-canstomp', 'RW'); $API_office_stompjes->return_url = false;