From 2df026bcb546002381592c51c939b3979bb920a6 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Thu, 22 Feb 2024 12:40:14 -0800 Subject: [PATCH] Allow updating asset default location when checking in asset via api --- app/Http/Controllers/Api/AssetsController.php | 4 ++++ tests/Feature/Api/Assets/AssetCheckinTest.php | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index cabf063f3d..2967471501 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -890,6 +890,10 @@ class AssetsController extends Controller if ($request->filled('location_id')) { $asset->location_id = $request->input('location_id'); + + if ($request->get('update_default_location') == 0){ + $asset->rtd_location_id = $request->get('location_id'); + } } if ($request->has('status_id')) { diff --git a/tests/Feature/Api/Assets/AssetCheckinTest.php b/tests/Feature/Api/Assets/AssetCheckinTest.php index 3eabdd076f..b7dda0d4b8 100644 --- a/tests/Feature/Api/Assets/AssetCheckinTest.php +++ b/tests/Feature/Api/Assets/AssetCheckinTest.php @@ -89,8 +89,6 @@ class AssetCheckinTest extends TestCase public function testDefaultLocationCanBeUpdatedUponCheckin() { - $this->markTestIncomplete('Not currently in controller'); - $location = Location::factory()->create(); $asset = Asset::factory()->assignedToUser()->create();