mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-26 05:01:06 -08:00
aha, got it working.
This commit is contained in:
parent
b239b3a4db
commit
c8341d9dc4
|
@ -626,8 +626,10 @@ class AssetsController extends Controller
|
|||
$asset->fill($request->validated());
|
||||
|
||||
// TODO: how much of this can go in the validator?
|
||||
($request->filled('model_id')) ?
|
||||
$asset->model()->associate(AssetModel::find($request->get('model_id'))) : null;
|
||||
// this is _always_ filled now, see UpdateAssetRequest
|
||||
// i'm leaving this here for now, but when would we ever want model_id to be `null`??
|
||||
($request->validated()['model_id']) ?
|
||||
$asset->model()->associate(AssetModel::find($request->validated()['model_id'])) : null;
|
||||
($request->filled('rtd_location_id')) ?
|
||||
$asset->location_id = $request->get('rtd_location_id') : '';
|
||||
($request->filled('company_id')) ?
|
||||
|
|
|
@ -38,7 +38,6 @@ class UpdateAssetRequest extends ImageUploadRequest
|
|||
$rules = array_merge(
|
||||
(new Asset())->getRules(),
|
||||
parent::rules(),
|
||||
//['model_id' => 'required|integer|exists:models,id,deleted_at,NULL|not_array']
|
||||
);
|
||||
|
||||
return $rules;
|
||||
|
|
Loading…
Reference in a new issue