mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -08:00
Fixed #15548 - unify audit due/overdue APIs
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
8cf1e4dceb
commit
de57d71bf1
|
@ -154,7 +154,8 @@ class AssetsController extends Controller
|
||||||
* Handle due and overdue audits and checkin dates
|
* Handle due and overdue audits and checkin dates
|
||||||
*/
|
*/
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'audits':
|
// Audit (singular) is left over from earlier legacy APIs
|
||||||
|
case ('audit' || 'audits'):
|
||||||
|
|
||||||
switch ($upcoming_status) {
|
switch ($upcoming_status) {
|
||||||
case 'due':
|
case 'due':
|
||||||
|
|
|
@ -495,13 +495,6 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi
|
||||||
)->name('api.assets.show.byserial')
|
)->name('api.assets.show.byserial')
|
||||||
->where('any', '.*');
|
->where('any', '.*');
|
||||||
|
|
||||||
// LEGACY URL - Get assets that are due or overdue for audit
|
|
||||||
Route::get('audit/{status}',
|
|
||||||
[
|
|
||||||
Api\AssetsController::class,
|
|
||||||
'index'
|
|
||||||
]
|
|
||||||
)->name('api.asset.to-audit');
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -512,7 +505,7 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi
|
||||||
'index'
|
'index'
|
||||||
]
|
]
|
||||||
)->name('api.assets.list-upcoming')
|
)->name('api.assets.list-upcoming')
|
||||||
->where(['action' => 'audits|checkins', 'upcoming_status' => 'due|overdue|due-or-overdue']);
|
->where(['action' => 'audit|audits|checkins', 'upcoming_status' => 'due|overdue|due-or-overdue']);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue