diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index 241b0f7b0e..9cd05b49ca 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -154,7 +154,8 @@ class AssetsController extends Controller * Handle due and overdue audits and checkin dates */ switch ($action) { - case 'audits': + // Audit (singular) is left over from earlier legacy APIs + case ('audit' || 'audits'): switch ($upcoming_status) { case 'due': diff --git a/routes/api.php b/routes/api.php index 108f2ac231..8e3c02af04 100644 --- a/routes/api.php +++ b/routes/api.php @@ -495,13 +495,6 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'throttle:api']], functi )->name('api.assets.show.byserial') ->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' ] )->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']);