From ab86e42b2ea6212c95369c06e306aa9192a10a4a Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 26 Jul 2019 12:37:38 -0700 Subject: [PATCH] Fixed #7270 - Checking-in Assets via API Removes the Item's Asset Name --- app/Http/Controllers/Api/AssetsController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index 95cf26962836..b55acc49225b 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -674,7 +674,11 @@ public function checkin(Request $request, $asset_id) $asset->assigned_to = null; $asset->assignedTo()->disassociate($asset); $asset->accepted = null; - $asset->name = Input::get('name'); + + if ($request->filled('name')) { + $asset->name = $request->input('name'); + } + $asset->location_id = $asset->rtd_location_id; if ($request->filled('location_id')) {