Fixes #4051 - use delete method for deleting user files

This commit is contained in:
snipe 2017-09-29 01:48:16 -07:00
parent ba8bcce8eb
commit 7fe2a1f802
2 changed files with 3 additions and 3 deletions

View file

@ -426,7 +426,7 @@
</td>
<td>
@can('update', $user)
<a class="btn delete-asset btn-danger btn-sm hidden-print" href="{{ route('delete/userfile', [$user->id, $file->id]) }}" data-content="Are you sure you wish to delete this file?" data-title="Delete {{ $file->filename }}?"><i class="fa fa-trash icon-white"></i></a>
<a class="btn delete-asset btn-danger btn-sm hidden-print" href="{{ route('userfile.destroy', [$user->id, $file->id]) }}" data-content="Are you sure you wish to delete this file?" data-title="Delete {{ $file->filename }}?"><i class="fa fa-trash icon-white"></i></a>
@endcan
</td>
</tr>

View file

@ -13,9 +13,9 @@ Route::group([ 'prefix' => 'users', 'middleware' => ['auth']], function () {
Route::get('{userId}/restore', [ 'as' => 'restore/user', 'uses' => 'UsersController@getRestore' ]);
Route::get('{userId}/unsuspend', [ 'as' => 'unsuspend/user', 'uses' => 'UsersController@getUnsuspend' ]);
Route::post('{userId}/upload', [ 'as' => 'upload/user', 'uses' => 'UsersController@postUpload' ]);
Route::get(
Route::delete(
'{userId}/deletefile/{fileId}',
[ 'as' => 'delete/userfile', 'uses' => 'UsersController@getDeleteFile' ]
[ 'as' => 'userfile.destroy', 'uses' => 'UsersController@getDeleteFile' ]
);
Route::get(
'{userId}/showfile/{fileId}',