Controller/API methods for due/overdue audits

We could probably skip this and just handle it via view in the routes…
This commit is contained in:
snipe 2019-05-05 19:13:37 -04:00
parent 52c9e8ad96
commit ab060288fa
2 changed files with 22 additions and 0 deletions

View file

@ -744,6 +744,18 @@ class AssetsController extends Controller
return view('hardware/audit')->with('asset', $asset)->with('next_audit_date', $dt)->with('locations_list');
}
public function dueForAudit()
{
$this->authorize('audit', Asset::class);
return view('hardware/audit-due');
}
public function overdueForAudit()
{
$this->authorize('audit', Asset::class);
return view('hardware/audit-overdue');
}
public function auditStore(AssetFileRequest $request, $id)
{

View file

@ -29,6 +29,16 @@ Route::group(
'uses' => 'AssetsController@scan'
]);
Route::get('audit/due', [
'as' => 'assets.audit.due',
'uses' => 'AssetsController@dueForAudit'
]);
Route::get('audit/overdue', [
'as' => 'assets.audit.overdue',
'uses' => 'AssetsController@overdueForAudit'
]);
Route::get('audit/{id}', [
'as' => 'asset.audit.create',
'uses' => 'AssetsController@audit'