From 41e7564aad05630064a386560ba7a4bc3ec16a19 Mon Sep 17 00:00:00 2001 From: addshore Date: Tue, 8 Dec 2020 19:31:36 +0000 Subject: [PATCH] Remove count wikis endpoint (not used) --- app/Http/Controllers/WikisController.php | 9 ---- routes/api.php | 6 +-- tests/Routes/Wiki/CountTest.php | 59 ------------------------ 3 files changed, 2 insertions(+), 72 deletions(-) delete mode 100644 tests/Routes/Wiki/CountTest.php diff --git a/app/Http/Controllers/WikisController.php b/app/Http/Controllers/WikisController.php index 14d39c9c..2ce20ecd 100644 --- a/app/Http/Controllers/WikisController.php +++ b/app/Http/Controllers/WikisController.php @@ -7,15 +7,6 @@ class WikisController extends Controller { - public function count() - { - $res['success'] = true; - // TODO only count active? - $res['data'] = Wiki::count(); - - return response($res); - } - public function getWikisOwnedByCurrentUser(Request $request) { // TODO FIXME, right now this returns alll of the details of the wiki managers :/ diff --git a/routes/api.php b/routes/api.php index 243d7314..b816668e 100644 --- a/routes/api.php +++ b/routes/api.php @@ -1,22 +1,20 @@ get('wiki/count', ['uses' => 'WikisController@count']); $router->get( 'healthz', function() { return 'It\'s Alive'; } ); + // POST $router->post('auth/login', ['uses' => 'Auth\LoginController@login']); // TODO actually use logout route in VUE app.. $router->post('auth/logout', ['uses' => 'Auth\LoginController@logout']); $router->post('user/register', ['uses' => 'Auth\RegisterController@register']); -// TODO finish converting for laravel below here $router->post('user/verifyEmail', ['uses' => 'UserVerificationTokenController@verify']); $router->post('user/forgotPassword', ['uses' => 'Auth\ForgotPasswordController@sendResetLinkEmail']); $router->post('user/resetPassword', ['uses' => 'Auth\ResetPasswordController@reset']); diff --git a/tests/Routes/Wiki/CountTest.php b/tests/Routes/Wiki/CountTest.php deleted file mode 100644 index 6d966760..00000000 --- a/tests/Routes/Wiki/CountTest.php +++ /dev/null @@ -1,59 +0,0 @@ -each(function ($a) { - $a->destroy($a->id); - }); - } - - public function testWikiCountNone() - { - $this->json('GET', '/wiki/count')->assertJson([ - 'data' => 0, - 'success' => true, - ]) - ->assertStatus(200); - } - - public function testWikiCountOne() - { - // TODO should wikis be counted if they have no db? - // TODO what actually is the use of this whole count?? - factory(Wiki::class, 'nodb')->create(); - $this->json('GET', $this->route)->assertJson([ - 'data' => 1, - 'success' => true, - ]) - ->assertStatus(200); - } - - public function testWikiCountTwo() - { - factory(Wiki::class, 'nodb')->create(); - factory(Wiki::class, 'nodb')->create(); - $this->json('GET', $this->route)->assertJson([ - 'data' => 2, - 'success' => true, - ]) - ->assertStatus(200); - } -}