-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
checkin API does not support setting checkin date #10552
Comments
JonathonReinhart
changed the title
checkin API does not support setting checkin date or asset name
checkin API does not support setting checkin date
Jan 24, 2022
I think it should be as easy as this, but I have not tried it yet: diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php
index 3b37a2875..859ec89eb 100644
--- a/app/Http/Controllers/Api/AssetsController.php
+++ b/app/Http/Controllers/Api/AssetsController.php
@@ -844,8 +844,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')));
} |
I tested this out by adding the diff above, and confirmed it was being set properly (with a debug print). But now I can't see where the checkin date (
Perhaps this worked previously but was broken? Here's where it was originally added: #6733 |
This was referenced Feb 6, 2022
JonathonReinhart
added a commit
to JonathonReinhart/snipe-it
that referenced
this issue
Feb 8, 2022
This was referenced Feb 8, 2022
Fixes #10627 Inconsistencies between checkout/checkin dates on asset history and activity log
#10635
Merged
JonathonReinhart
added a commit
to JonathonReinhart/snipe-it
that referenced
this issue
Feb 9, 2022
9 tasks
snipe
added a commit
that referenced
this issue
Feb 10, 2022
…-date Fix #10552: Add checkin_at parameter to /hardware/:id/checkin API
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Snipe-IT Version
v5.3.7
Problem
When checking in an asset via the web UI, the following form fields exist:
However, the
/hardware/:id/checkin
API does not support all of these:Solution
Api/AssetsController.checkin()
should add fields which match the names used by the normal UI controllercheckin_at
Alternatives
None.
The text was updated successfully, but these errors were encountered: