Fixes #11452 - Asset Restore routes/buttons also asset models/users restore as well #11453
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes #11452
The restore asset button is a POST form, while the route was a GET. Changed the route to be POST.
I would probably do that as a PATCH, and/or use the API route instead since they are basically duplicates but this would at least get it working for now.
Had to modify the genericActionsFormatter to use a POST form instead of a link. This also affected some other restores. Fixing the formatter got the asset model restore working from the table. This time the route was POST and the button was a link since it came from that formatter. Modifying the genericActionsFormatter also effected the users restore from the deleted users table.
Changes:
Bootstrap tables partial view:
Change genericActionsFormatter to have a POST form instead of link for restore.
Asset Routes:
Changed restore route to POST
User Routes:
Changed restore route to POST.
Removed duplicate routes.
Users view:
Updated the user view to use a POST form a well.
Removed the link in the alert since it just duplicated the action button on the ride side. If you want I can add that back as a form.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Asset can be restored from it's view
Asset can be restored from deleted assets table
Asset model can be restored from show deleted table
User can be restored from it's view
User can be restored from show deleted table
Test Configuration:
Checklist: