diff --git a/application/controllers/api/v1/Test.php b/application/controllers/api/v1/Test.php index 1b4dc5c82..fd1896560 100644 --- a/application/controllers/api/v1/Test.php +++ b/application/controllers/api/v1/Test.php @@ -2,8 +2,6 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); -//require_once APPPATH . '/libraries/REST_Controller.php'; - /** * Testing class for REST calls and authentication */ @@ -16,37 +14,17 @@ class Test extends APIv1_Controller /** * Test HTTP GET method - * It responses whith the HTTP status 200 and prints this JSON string - * {"success":true,"message":"API HTTP GET call test succeed"} - * - * @return void */ public function getTest() { - $payload = [ - 'success' => TRUE, - 'message' => 'API HTTP GET call test succeed', - 'error' => 0 - ]; - $httpstatus = REST_Controller::HTTP_OK; - $this->response($payload, $httpstatus); + $this->response(success('API HTTP GET call test succeed'), REST_Controller::HTTP_OK); } - + /** * Test HTTP POST method - * * It responses whith the HTTP status 200 and prints this JSON string - * {"success":true,"message":"API HTTP POST call test succeed"} - * - * @return void */ public function postTest() { - $payload = [ - 'success' => TRUE, - 'message' => 'API HTTP POST call test succeed', - 'error' => 0 - ]; - $httpstatus = REST_Controller::HTTP_OK; - $this->response($payload, $httpstatus); + $this->response(success('API HTTP POST call test succeed'), REST_Controller::HTTP_OK); } }