From b99c7f83e13d9af2227016b1a8dd684d2a85a8ab Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Thu, 2 Aug 2018 15:47:02 +0200 Subject: fix the way we define the routes Signed-off-by: Bjoern Schiessle --- appinfo/routes.php | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) (limited to 'appinfo') diff --git a/appinfo/routes.php b/appinfo/routes.php index 1a3bde6..5a8fac4 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -19,28 +19,10 @@ * */ -$application = new \OCA\Survey_Client\AppInfo\Application(); - -\OCP\API::register( - 'post', - '/apps/survey_client/api/v1/report', - [$application->getContainer()->query('EndpointController'), 'sendReport'], - 'survey_client', - \OCP\API::ADMIN_AUTH -); - -\OCP\API::register( - 'post', - '/apps/survey_client/api/v1/monthly', - [$application->getContainer()->query('EndpointController'), 'enableMonthly'], - 'survey_client', - \OCP\API::ADMIN_AUTH -); - -\OCP\API::register( - 'delete', - '/apps/survey_client/api/v1/monthly', - [$application->getContainer()->query('EndpointController'), 'disableMonthly'], - 'survey_client', - \OCP\API::ADMIN_AUTH -); +return [ + 'ocs' => [ + ['name' => 'Endpoint#sendReport', 'url' => '/api/v1/report', 'verb' => 'POST'], + ['name' => 'Endpoint#enableMonthly', 'url' => '/api/v1/monthly', 'verb' => 'POST'], + ['name' => 'Endpoint#disableMonthly', 'url' => '/api/v1/monthly', 'verb' => 'DELETE'], + ], +]; -- cgit v1.2.3