Canviat mètode POST getClasses per GET getCurrentClasses
El mètode GET és més adequat per aquest tipus de peticions.
Change-Id: I6f4a233962f216c126a2327463f82e4fe55d2214
diff --git a/inc/API.php b/inc/API.php
index f1763ea..8ecfdd1 100644
--- a/inc/API.php
+++ b/inc/API.php
@@ -143,13 +143,15 @@
self::returnError();
break;
- case 'getClasses':
- $body = self::getJSONBody();
- $response = Classes::handleAPIGetClasses($body);
- if ($response === false)
+ case 'getCurrentClasses':
+ self::checkRequestMethod('GET');
+ $classes = Classes::getCurrentClasses();
+ if ($classes === false)
self::returnError();
else
- self::returnPayload($response);
+ self::returnPayload([
+ 'classes' => $classes
+ ]);
break;
case 'setClassState':