mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Fix integrity constraint violation on sqlite.
If the requestable checkbox was not checked, it did not exist in the request. Setting requestable to null in such a case would cause a violation because it should be 0/1. Also fix a copy/paste where we reset requestable after checking for rtd_location_id.
This commit is contained in:
parent
2867cd523d
commit
d3b035cfe9
|
@ -352,16 +352,13 @@ class AssetsController extends Controller
|
|||
$asset->supplier_id = null;
|
||||
}
|
||||
|
||||
if ($request->has('requestable')) {
|
||||
$asset->requestable = e($request->input('requestable'));
|
||||
} else {
|
||||
$asset->requestable = null;
|
||||
}
|
||||
// If the box isn't checked, it's not in the request at all.
|
||||
$asset->requestable = $request->has('requestable');
|
||||
|
||||
if ($request->has('rtd_location_id')) {
|
||||
$asset->rtd_location_id = e($request->input('rtd_location_id'));
|
||||
} else {
|
||||
$asset->requestable = null;
|
||||
$asset->rtd_location_id = null;
|
||||
}
|
||||
|
||||
if ($request->has('image_delete')) {
|
||||
|
|
Loading…
Reference in a new issue