diff --git a/routes/api.php b/routes/api.php index 11a489d2..c4c76d0f 100644 --- a/routes/api.php +++ b/routes/api.php @@ -12,7 +12,7 @@ Route::prefix('user')->middleware('auth:jwt,oauth')->group(function () { Route::get('', 'UserController@user'); Route::get('notifications', 'NotificationsController@all'); - Route::get('notifications/{id}', 'NotificationsController@read'); + Route::post('notifications/{id}', 'NotificationsController@read'); }); Route::prefix('players')->middleware('auth:jwt,oauth')->group(function () { diff --git a/routes/web.php b/routes/web.php index 91d0175c..9f65b8b3 100644 --- a/routes/web.php +++ b/routes/web.php @@ -48,7 +48,7 @@ Route::prefix('user') ->middleware(['authorize']) ->group(function () { Route::get('', 'UserController@index')->name('home'); - Route::get('notifications/{id}', 'NotificationsController@read')->name('notification'); + Route::post('notifications/{id}', 'NotificationsController@read')->name('notification'); Route::get('score-info', 'UserController@scoreInfo')->name('score'); Route::post('sign', 'UserController@sign')->name('sign'); diff --git a/tests/HttpTest/ControllersTest/NotificationsControllerTest.php b/tests/HttpTest/ControllersTest/NotificationsControllerTest.php index 1e68fdf2..6bed9e0d 100644 --- a/tests/HttpTest/ControllersTest/NotificationsControllerTest.php +++ b/tests/HttpTest/ControllersTest/NotificationsControllerTest.php @@ -114,7 +114,7 @@ class NotificationsControllerTest extends TestCase $this->actingAs($user)->get('/user')->assertSee('Hyouka'); - $this->get('/user/notifications/'.$notification->id) + $this->postJson('/user/notifications/'.$notification->id) ->assertJson([ 'title' => $notification->data['title'], 'content' => (new Parsedown())->text($notification->data['content']),