A free open source IT asset/license management system
Improve variable type
Marcus Moore5084e5d3ef8f
diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.phpindex 5f010bdbb7..d78a2074f9 100644--- a/app/Http/Controllers/Api/AssetsController.php+++ b/app/Http/Controllers/Api/AssetsController.php@@ -899,8 +899,8 @@ class AssetsController extends Controllerif ($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->input('update_default_location')){+ $asset->rtd_location_id = $request->input('location_id');}}diff --git a/tests/Feature/Api/Assets/AssetCheckinTest.php b/tests/Feature/Api/Assets/AssetCheckinTest.phpindex 060d0aacd1..27d5e6de80 100644--- a/tests/Feature/Api/Assets/AssetCheckinTest.php+++ b/tests/Feature/Api/Assets/AssetCheckinTest.php@@ -103,7 +103,7 @@ class AssetCheckinTest extends TestCase$this->actingAsForApi(User::factory()->checkinAssets()->create())->postJson(route('api.asset.checkin', $asset), ['location_id' => $location->id,- 'update_default_location' => 0+ 'update_default_location' => true,]);$this->assertTrue($asset->refresh()->defaultLoc()->is($location));