From 7ff961fc2124dce09bc2c26f819029457b0bf43f Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Fri, 21 Nov 2014 10:33:15 +0100 Subject: [PATCH] Moved history controller to routes --- .../GetHistory.php} | 17 +++++++++++------ src/di.php | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) rename src/{Controllers/HistoryController.php => Routes/GetHistory.php} (84%) diff --git a/src/Controllers/HistoryController.php b/src/Routes/GetHistory.php similarity index 84% rename from src/Controllers/HistoryController.php rename to src/Routes/GetHistory.php index 2291f8c0..9f205339 100644 --- a/src/Controllers/HistoryController.php +++ b/src/Routes/GetHistory.php @@ -1,14 +1,14 @@ snapshotViewProxy = $snapshotViewProxy; } - public function registerRoutes(Router $router) + public function getMethods() { - $router->get('/api/history', [$this, 'getFiltered']); + return ['GET']; } - public function getFiltered() + public function getUrl() + { + return '/api/history'; + } + + public function work() { $this->privilegeService->assertPrivilege(Privilege::VIEW_HISTORY); diff --git a/src/di.php b/src/di.php index d846c0f4..c71e2586 100644 --- a/src/di.php +++ b/src/di.php @@ -62,7 +62,6 @@ return [ $container->get(\Szurubooru\Controllers\PostController::class), $container->get(\Szurubooru\Controllers\PostContentController::class), $container->get(\Szurubooru\Controllers\PostNotesController::class), - $container->get(\Szurubooru\Controllers\HistoryController::class), $container->get(\Szurubooru\Controllers\ScoreController::class), $container->get(\Szurubooru\Controllers\TagController::class), ]; @@ -72,6 +71,7 @@ return [ return [ $container->get(\Szurubooru\Routes\Login::class), $container->get(\Szurubooru\Routes\GetGlobals::class), + $container->get(\Szurubooru\Routes\GetHistory::class), $container->get(\Szurubooru\Routes\Comments\AddComment::class), $container->get(\Szurubooru\Routes\Comments\EditComment::class), $container->get(\Szurubooru\Routes\Comments\DeleteComment::class),