Merge pull request #10943 from snipe/fixes/add_status_id_to_checkout_api

Added status_id to asset checkout API
This commit is contained in:
snipe 2022-04-15 14:38:44 +01:00 committed by GitHub
commit 9a0219eff7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -788,6 +788,9 @@ class AssetsController extends Controller
$error_payload['target_type'] = 'user';
}
if ($request->filled('status_id')) {
$asset->status_id = $request->get('status_id');
}
if (!isset($target)) {

View file

@ -25,6 +25,7 @@ class AssetCheckoutRequest extends Request
"assigned_user" => 'required_without_all:assigned_asset,assigned_location',
"assigned_asset" => 'required_without_all:assigned_user,assigned_location',
"assigned_location" => 'required_without_all:assigned_user,assigned_asset',
'status_id' => 'exists:status_labels,id,deployable,1',
"checkout_to_type" => 'required|in:asset,location,user'
];