update route of notifications

This commit is contained in:
Pig Fang 2020-06-30 09:28:22 +08:00
parent db74a9c051
commit c8af8ccd3e
No known key found for this signature in database
GPG Key ID: A8198F548DADA9E2
3 changed files with 3 additions and 3 deletions

View File

@ -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 () {

View File

@ -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');

View File

@ -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']),