Explorar o código

added new plugins/marketplace api endpoint

CauseFX %!s(int64=4) %!d(string=hai) anos
pai
achega
ad926084c3
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      api/v2/routes/settings.php

+ 10 - 0
api/v2/routes/settings.php

@@ -9,6 +9,16 @@ $app->get('/settings/appearance', function ($request, $response, $args) {
 		->withHeader('Content-Type', 'application/json;charset=UTF-8')
 		->withStatus($GLOBALS['responseCode']);
 });
+$app->get('/settings/plugin', function ($request, $response, $args) {
+	$Organizr = ($request->getAttribute('Organizr')) ?? new Organizr();
+	if ($Organizr->qualifyRequest(1, true)) {
+		$GLOBALS['api']['response']['data'] = $Organizr->getPluginSettings();
+	}
+	$response->getBody()->write(jsonE($GLOBALS['api']));
+	return $response
+		->withHeader('Content-Type', 'application/json;charset=UTF-8')
+		->withStatus($GLOBALS['responseCode']);
+});
 $app->get('/settings/main', function ($request, $response, $args) {
 	$Organizr = ($request->getAttribute('Organizr')) ?? new Organizr();
 	if ($Organizr->qualifyRequest(1, true)) {