GET stomp API call added

This commit is contained in:
2026-06-13 23:21:17 +02:00
parent c408e43283
commit 98d5d1cb18
2 changed files with 17 additions and 2 deletions

View File

@@ -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);
}
}

View File

@@ -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;