update route of notifications
This commit is contained in:
parent
db74a9c051
commit
c8af8ccd3e
|
|
@ -12,7 +12,7 @@ Route::prefix('user')->middleware('auth:jwt,oauth')->group(function () {
|
||||||
Route::get('', 'UserController@user');
|
Route::get('', 'UserController@user');
|
||||||
|
|
||||||
Route::get('notifications', 'NotificationsController@all');
|
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 () {
|
Route::prefix('players')->middleware('auth:jwt,oauth')->group(function () {
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ Route::prefix('user')
|
||||||
->middleware(['authorize'])
|
->middleware(['authorize'])
|
||||||
->group(function () {
|
->group(function () {
|
||||||
Route::get('', 'UserController@index')->name('home');
|
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::get('score-info', 'UserController@scoreInfo')->name('score');
|
||||||
Route::post('sign', 'UserController@sign')->name('sign');
|
Route::post('sign', 'UserController@sign')->name('sign');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ class NotificationsControllerTest extends TestCase
|
||||||
|
|
||||||
$this->actingAs($user)->get('/user')->assertSee('Hyouka');
|
$this->actingAs($user)->get('/user')->assertSee('Hyouka');
|
||||||
|
|
||||||
$this->get('/user/notifications/'.$notification->id)
|
$this->postJson('/user/notifications/'.$notification->id)
|
||||||
->assertJson([
|
->assertJson([
|
||||||
'title' => $notification->data['title'],
|
'title' => $notification->data['title'],
|
||||||
'content' => (new Parsedown())->text($notification->data['content']),
|
'content' => (new Parsedown())->text($notification->data['content']),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user