Merge pull request #8239 from snipe/fixes/api_rtd_to_location_on_create

Set location_id to rtd_location_id on asset creation
This commit is contained in:
snipe 2020-07-16 17:44:13 -07:00 committed by GitHub
commit 34aa12e229
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View file

@ -453,6 +453,7 @@ class AssetsController extends Controller
$asset->supplier_id = $request->get('supplier_id', 0);
$asset->requestable = $request->get('requestable', 0);
$asset->rtd_location_id = $request->get('rtd_location_id', null);
$asset->location_id = $request->get('rtd_location_id', null);
// Update custom fields in the database.
// Validation for these fields is handled through the AssetRequest form request

View file

@ -137,6 +137,7 @@ class AssetsController extends Controller
$asset->supplier_id = request('supplier_id', 0);
$asset->requestable = request('requestable', 0);
$asset->rtd_location_id = request('rtd_location_id', null);
if ($asset->assigned_to=='') {
$asset->location_id = $request->input('rtd_location_id', null);