diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index d4e7a7a8b..ebb19159d 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -746,7 +746,21 @@ class AssetsController extends Controller return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/hardware/message.does_not_exist')), 200); } - + /** + * Checkout an asset by its tag. + * + * @author [N. Butler] + * @param string $tag + * @since [v6.0.5] + * @return JsonResponse + */ + public function checkoutByTag(AssetCheckoutRequest $request, $tag) + { + if ($asset = Asset::where('asset_tag', $tag)->first()) { + return $this->checkout($request, $asset->id); + } + return response()->json(Helper::formatStandardApiResponse('error', null, 'Asset not found'), 200); + } /** * Checkout an asset diff --git a/config/version.php b/config/version.php index f5fc4bb38..fd17b0c4c 100644 --- a/config/version.php +++ b/config/version.php @@ -1,10 +1,10 @@ 'v6.0.5', - 'full_app_version' => 'v6.0.5 - build 8230-g393c32558', - 'build_version' => '8230', + 'full_app_version' => 'v6.0.5 - build 8229-g94e723a88', + 'build_version' => '8229', 'prerelease_version' => '', - 'hash_version' => 'g393c32558', - 'full_hash' => 'v6.0.5-102-g393c32558', - 'branch' => 'master', + 'hash_version' => 'g94e723a88', + 'full_hash' => 'v6.0.5-101-g94e723a88', + 'branch' => 'develop', ); \ No newline at end of file diff --git a/routes/api.php b/routes/api.php index 3c0ab53c7..da2e92ee1 100644 --- a/routes/api.php +++ b/routes/api.php @@ -462,6 +462,13 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi )->name('api.assets.show.bytag') ->where('any', '.*'); + Route::post('bytag/{any}/checkout', + [ + Api\AssetsController::class, + 'checkoutByTag' + ] + )->name('api.assets.checkout.bytag'); + Route::get('byserial/{any}', [ Api\AssetsController::class,