Merge remote-tracking branch 'origin/develop'

This commit is contained in:
snipe 2022-06-29 05:04:21 -07:00
commit 180f36d145
3 changed files with 27 additions and 6 deletions

View file

@ -746,7 +746,21 @@ class AssetsController extends Controller
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/hardware/message.does_not_exist')), 200); 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 * Checkout an asset

View file

@ -1,10 +1,10 @@
<?php <?php
return array ( return array (
'app_version' => 'v6.0.5', 'app_version' => 'v6.0.5',
'full_app_version' => 'v6.0.5 - build 8230-g393c32558', 'full_app_version' => 'v6.0.5 - build 8229-g94e723a88',
'build_version' => '8230', 'build_version' => '8229',
'prerelease_version' => '', 'prerelease_version' => '',
'hash_version' => 'g393c32558', 'hash_version' => 'g94e723a88',
'full_hash' => 'v6.0.5-102-g393c32558', 'full_hash' => 'v6.0.5-101-g94e723a88',
'branch' => 'master', 'branch' => 'develop',
); );

View file

@ -462,6 +462,13 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi
)->name('api.assets.show.bytag') )->name('api.assets.show.bytag')
->where('any', '.*'); ->where('any', '.*');
Route::post('bytag/{any}/checkout',
[
Api\AssetsController::class,
'checkoutByTag'
]
)->name('api.assets.checkout.bytag');
Route::get('byserial/{any}', Route::get('byserial/{any}',
[ [
Api\AssetsController::class, Api\AssetsController::class,