mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 22:37:28 -08:00
more cleanup to fit formatting convention
This commit is contained in:
parent
87ef37b0b4
commit
08cb8c354b
|
@ -856,16 +856,13 @@ class AssetsController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Bulk Checkin an asset
|
||||
* This is the current solution to perform a bulk api checkin based on an asset tag, rather than a regular checkin.
|
||||
* This is due to the need to find the asset first based on the asset tag.
|
||||
* Checkin an asset by asset tag
|
||||
*
|
||||
* @author [A. Janes] [<ajanes@adagiohealth.org>]
|
||||
* @param int $assetId
|
||||
* @since [v4.0]
|
||||
* @since [v6.0]
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function bulkCheckin(Request $request)
|
||||
public function checkinByTag(Request $request)
|
||||
{
|
||||
$this->authorize('checkin', Asset::class);
|
||||
$asset = Asset::with('assetstatus')->where('asset_tag', $request->input('asset_tag'))->first();
|
||||
|
@ -875,8 +872,8 @@ class AssetsController extends Controller
|
|||
}
|
||||
|
||||
return response()->json(Helper::formatStandardApiResponse('error', [
|
||||
'asset'=> e($request->input('asset_tag'))
|
||||
], 'Asset with tag '.e($request->input('asset_tag')).' not found'));
|
||||
'asset'=> e($request->input('asset'))
|
||||
], 'Asset with tag '.e($request->input('asset')).' not found'));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@
|
|||
var formData = $('#checkin-form').serializeArray();
|
||||
|
||||
$.ajax({
|
||||
url: "{{ route('api.asset.bulkcheckin') }}",
|
||||
url: "{{ route('api.asset.checkinbytag') }}",
|
||||
type : 'POST',
|
||||
headers: {
|
||||
"X-Requested-With": 'XMLHttpRequest',
|
||||
|
|
|
@ -467,12 +467,12 @@ Route::group(['prefix' => 'v1', 'middleware' => 'api'], function () {
|
|||
]
|
||||
)->name('api.asset.checkin');
|
||||
|
||||
Route::post('bulkcheckin',
|
||||
[
|
||||
Api\AssetsController::class,
|
||||
'bulkcheckin'
|
||||
]
|
||||
)->name('api.asset.bulkcheckin');
|
||||
Route::post('checkinbytag',
|
||||
[
|
||||
Api\AssetsController::class,
|
||||
'checkinbytag'
|
||||
]
|
||||
)->name('api.asset.checkinbytag');
|
||||
|
||||
Route::post('checkout',
|
||||
[
|
||||
|
|
Loading…
Reference in a new issue