mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Make sure the asset is available for checkout before displaying the checkout screen
This commit is contained in:
parent
305b0d8edb
commit
804b49cefb
|
@ -431,8 +431,13 @@ class AssetsController extends Controller
|
||||||
|
|
||||||
$this->authorize('checkout', $asset);
|
$this->authorize('checkout', $asset);
|
||||||
|
|
||||||
|
if ($asset->availableForCheckout()) {
|
||||||
|
return view('hardware/checkout', compact('asset'));
|
||||||
|
}
|
||||||
|
return redirect()->route('hardware.index')->with('error', trans('admin/hardware/message.checkout.not_available'));
|
||||||
|
|
||||||
// Get the dropdown of users and then pass it to the checkout view
|
// Get the dropdown of users and then pass it to the checkout view
|
||||||
return view('hardware/checkout', compact('asset'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue