delete some extra lines

This commit is contained in:
spencerrlongg 2024-03-20 15:29:06 -05:00
parent e3e01e07b1
commit e7b9903341

View file

@ -631,7 +631,6 @@ class AssetsController extends Controller
{
$asset->fill($request->validated());
if ($request->has('model_id')) {
$asset->model()->associate(AssetModel::find($request->validated()['model_id']));
}
@ -642,7 +641,6 @@ class AssetsController extends Controller
$asset->location_id = $request->validated()['rtd_location_id'];
}
/**
* this is here just legacy reasons. Api\AssetController
* used image_source once to allow encoded image uploads.
@ -669,7 +667,6 @@ class AssetsController extends Controller
}
}
if ($asset->save()) {
if (($request->filled('assigned_user')) && ($target = User::find($request->get('assigned_user')))) {
$location = $target->location_id;
@ -689,10 +686,8 @@ class AssetsController extends Controller
if ($asset->image) {
$asset->image = $asset->getImageUrl();
}
return response()->json(Helper::formatStandardApiResponse('success', $asset, trans('admin/hardware/message.update.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, $asset->getErrors()), 200);
}