most tests now passing, still one broken

This commit is contained in:
spencerrlongg
2024-03-19 19:47:26 -05:00
parent c0110e7f29
commit 1e810d2426
2 changed files with 12 additions and 13 deletions
@@ -629,14 +629,12 @@ class AssetsController extends Controller
// this is _always_ filled now, see UpdateAssetRequest
// i'm leaving it like this for now, but when would we ever want model_id to be `null`??
// it actually breaks at the model validation if it gets to null...
($request->validated()['model_id']) ?
($request->has('model_id')) ?
$asset->model()->associate(AssetModel::find($request->validated()['model_id'])) : null;
//($request->validated()['rtd_location_id']) ?
// $asset->location_id = $request->validated()['rtd_location_id'] : '';
//($request->validated()['company_id']) ?
// $asset->company_id = Company::getIdForCurrentUser($request->validated()['company_id']) : '';
//($request->validated()['rtd_location_id']) ?
// $asset->location_id = $request->validated()['rtd_location_id'] : null;
($request->has('company_id')) ?
$asset->company_id = Company::getIdForCurrentUser($request->validated()['company_id']) : null;
($request->has('rtd_location_id')) ?
$asset->location_id = $request->validated()['rtd_location_id'] : null;
/**
* this is here just legacy reasons. Api\AssetController