Merge pull request #10640 from JonathonReinhart/10552-add-checkin-api-date

Fix #10552: Add checkin_at parameter to /hardware/:id/checkin API
This commit is contained in:
snipe 2022-02-10 09:54:20 -08:00 committed by GitHub
commit 70af10ae6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -860,8 +860,13 @@ class AssetsController extends Controller
$asset->status_id = $request->input('status_id');
}
$checkin_at = null;
if ($request->filled('checkin_at')) {
$checkin_at = $request->input('checkin_at');
}
if ($asset->save()) {
event(new CheckoutableCheckedIn($asset, $target, Auth::user(), $request->input('note')));
event(new CheckoutableCheckedIn($asset, $target, Auth::user(), $request->input('note'), $checkin_at));
return response()->json(Helper::formatStandardApiResponse('success', ['asset'=> e($asset->asset_tag)], trans('admin/hardware/message.checkin.success')));
}