From 7192077919c88c601a6047759a5f5726e7426b7d Mon Sep 17 00:00:00 2001 From: sualko Date: Wed, 17 Jun 2020 10:51:31 +0200 Subject: [PATCH] refactor: remove unused controller --- appinfo/routes.php | 3 - lib/Controller/RoomApiController.php | 103 --------------------------- 2 files changed, 106 deletions(-) delete mode 100644 lib/Controller/RoomApiController.php diff --git a/appinfo/routes.php b/appinfo/routes.php index 92fc1f2..3e54be4 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -3,7 +3,6 @@ return [ 'resources' => [ 'room' => ['url' => '/rooms'], 'roomShare' => ['url' => '/roomShares'], - 'room_api' => ['url' => '/api/0.1/rooms'], ], 'routes' => [ ['name' => 'server#records', 'url' => '/server/{roomUid}/records', 'verb' => 'GET'], @@ -11,7 +10,5 @@ return [ ['name' => 'server#version', 'url' => '/server/version', 'verb' => 'GET'], ['name' => 'server#delete_record', 'url' => '/server/record/{recordId}', 'verb' => 'DELETE'], ['name' => 'join#index', 'url' => '/b/{token}', 'verb' => 'GET'], - ['name' => 'room_api#preflighted_cors', 'url' => '/api/0.1/{path}', - 'verb' => 'OPTIONS', 'requirements' => ['path' => '.+']] ] ]; \ No newline at end of file diff --git a/lib/Controller/RoomApiController.php b/lib/Controller/RoomApiController.php deleted file mode 100644 index 0228259..0000000 --- a/lib/Controller/RoomApiController.php +++ /dev/null @@ -1,103 +0,0 @@ -service = $service; - $this->userId = $userId; - } - - /** - * @CORS - * @NoCSRFRequired - * @NoAdminRequired - */ - public function index(): DataResponse - { - return new DataResponse($this->service->findAll($this->userId)); - } - - /** - * @CORS - * @NoCSRFRequired - * @NoAdminRequired - */ - public function show(int $id): DataResponse - { - return $this->handleNotFound(function () use ($id) { - return $this->service->find($id, $this->userId); - }); - } - - /** - * @CORS - * @NoCSRFRequired - * @NoAdminRequired - */ - public function create( - string $name, - string $welcome, - int $maxParticipants, - bool $record - ): DataResponse { - return new DataResponse($this->service->create( - $name, - $welcome, - $maxParticipants, - $record, - $this->userId - )); - } - - /** - * @CORS - * @NoCSRFRequired - * @NoAdminRequired - */ - public function update( - int $id, - string $name, - string $welcome, - int $maxParticipants, - bool $record, - string $access - ): DataResponse { - return $this->handleNotFound(function () use ($id, $name, $welcome, $maxParticipants, $record, $access) { - return $this->service->update($id, $name, $welcome, $maxParticipants, $record, $access, $this->userId); - }); - } - - /** - * @CORS - * @NoCSRFRequired - * @NoAdminRequired - */ - public function destroy(int $id): DataResponse - { - return $this->handleNotFound(function () use ($id) { - return $this->service->delete($id, $this->userId); - }); - } -}