Modify genericActionsFormatter restore link to be a button instead since it's in a form.

Changed user restore route to POST
This commit is contained in:
Mike Roquemore 2022-07-02 13:27:16 -05:00
parent 02459aad26
commit 123963c14c
2 changed files with 4 additions and 4 deletions

View file

@ -282,7 +282,7 @@
if ((row.available_actions) && (row.available_actions.restore === true)) {
actions += '<form style="display: inline;" method="POST" action="{{ url('/') }}/' + dest + '/' + row.id + '/restore"> ';
actions += '@csrf';
actions += '<a href="{{ url('/') }}/' + dest + '/' + row.id + '/restore" class="btn btn-sm btn-warning" data-toggle="tooltip" title="{{ trans('general.restore') }}"><i class="far fa-clone"></i></a>&nbsp;';
actions += '<button class="btn btn-sm btn-warning" data-toggle="tooltip" title="{{ trans('general.restore') }}"><i class="far fa-clone"></i></button>&nbsp;';
actions += '<i class="fa fa-retweet" aria-hidden="true"></i><span class="sr-only">{{ trans('general.restore') }}</span></button></form>&nbsp;';
}
@ -780,4 +780,4 @@
</script>
@endpush
@endpush

View file

@ -88,7 +88,7 @@ Route::group(['prefix' => 'users', 'middleware' => ['auth']], function () {
]
)->name('clone/user');
Route::get(
Route::post(
'{userId}/restore',
[
Users\UsersController::class,
@ -175,4 +175,4 @@ Route::group(['prefix' => 'users', 'middleware' => ['auth']], function () {
Route::resource('users', Users\UsersController::class, [
'middleware' => ['auth'],
'parameters' => ['user' => 'user_id'],
]);
]);