mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Updated routes with new endpoints
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
9b04d2e51c
commit
5fceef1dc3
|
@ -536,6 +536,7 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi
|
||||||
'restore'
|
'restore'
|
||||||
]
|
]
|
||||||
)->name('api.assets.restore');
|
)->name('api.assets.restore');
|
||||||
|
|
||||||
Route::post('{asset_id}/files',
|
Route::post('{asset_id}/files',
|
||||||
[
|
[
|
||||||
Api\AssetFilesController::class,
|
Api\AssetFilesController::class,
|
||||||
|
@ -563,8 +564,30 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi
|
||||||
'destroy'
|
'destroy'
|
||||||
]
|
]
|
||||||
)->name('api.assets.files.destroy');
|
)->name('api.assets.files.destroy');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** Begin assigned routes */
|
||||||
|
Route::get('{asset}/assigned/assets',
|
||||||
|
[
|
||||||
|
Api\AssetsController::class,
|
||||||
|
'assignedAssets'
|
||||||
|
]
|
||||||
|
)->name('api.assets.assigned_assets');
|
||||||
|
|
||||||
|
Route::get('{asset}/assigned/accessories',
|
||||||
|
[
|
||||||
|
Api\AssetsController::class,
|
||||||
|
'assignedAccessories'
|
||||||
|
]
|
||||||
|
)->name('api.assets.assigned_accessories');
|
||||||
|
/** End assigned routes */
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// pulling this out of resource route group to begin normalizing for route-model binding.
|
// pulling this out of resource route group to begin normalizing for route-model binding.
|
||||||
// this would probably keep working with the resource route group, but the general practice is for
|
// this would probably keep working with the resource route group, but the general practice is for
|
||||||
// the model name to be the parameter - and i think it's a good differentiation in the code while we convert the others.
|
// the model name to be the parameter - and i think it's a good differentiation in the code while we convert the others.
|
||||||
|
@ -705,6 +728,8 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi
|
||||||
]
|
]
|
||||||
)->name('api.locations.viewusers');
|
)->name('api.locations.viewusers');
|
||||||
|
|
||||||
|
|
||||||
|
// Legacy URL for compatibility
|
||||||
Route::get('{location}/assets',
|
Route::get('{location}/assets',
|
||||||
[
|
[
|
||||||
Api\LocationsController::class,
|
Api\LocationsController::class,
|
||||||
|
@ -712,13 +737,23 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi
|
||||||
]
|
]
|
||||||
)->name('api.locations.viewassets');
|
)->name('api.locations.viewassets');
|
||||||
|
|
||||||
|
|
||||||
|
// Add a comment here, you moron
|
||||||
|
/** Begin assigned routes */
|
||||||
|
Route::get('{location}/assigned/assets',
|
||||||
|
[
|
||||||
|
Api\LocationsController::class,
|
||||||
|
'assignedAssets'
|
||||||
|
]
|
||||||
|
)->name('api.locations.assigned_assets');
|
||||||
|
|
||||||
Route::get('{location}/assigned/accessories',
|
Route::get('{location}/assigned/accessories',
|
||||||
[
|
[
|
||||||
Api\LocationsController::class,
|
Api\LocationsController::class,
|
||||||
'assignedAccessories'
|
'assignedAccessories'
|
||||||
]
|
]
|
||||||
)->name('api.locations.assigned_accessories');
|
)->name('api.locations.assigned_accessories');
|
||||||
|
/** End assigned routes */
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::resource('locations',
|
Route::resource('locations',
|
||||||
|
|
Loading…
Reference in a new issue