Merge pull request #13904 from snipe/fixes/redirect_to_consumable_on_invalid_category

Redirect back to the specific consumable for correction
This commit is contained in:
snipe 2023-11-20 15:40:40 +00:00 committed by GitHub
commit c14b3d9780
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,7 +36,7 @@ class ConsumableCheckoutController extends Controller
// Make sure there is a valid category
if (!$consumable->category){
return redirect()->route('consumables.index')->with('error', trans('general.invalid_item_category_single', ['type' => trans('general.consumable')]));
return redirect()->route('consumables.edit', ['consumable' => $consumable->id])->with('error', trans('general.invalid_item_category_single', ['type' => trans('general.consumable')]));
}
$this->authorize('checkout', $consumable);