Skip to content

Commit

Permalink
Add checkin_at parameter to /hardware/:id/checkin API
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathonReinhart committed Feb 9, 2022
1 parent 7a117a2 commit 3536d08
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/Http/Controllers/Api/AssetsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -860,8 +860,13 @@ public function checkin(Request $request, $asset_id)
$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')));
}
Expand Down

0 comments on commit 3536d08

Please sign in to comment.