Fixed #15548 - unify audit due/overdue APIs

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-09-24 16:30:24 +01:00
parent 8cf1e4dceb
commit de57d71bf1
2 changed files with 3 additions and 9 deletions

View file

@ -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':

View file

@ -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']);