Skip to content

Commit

Permalink
Add list of inspections to API
Browse files Browse the repository at this point in the history
  • Loading branch information
pvgennip committed Oct 23, 2020
1 parent b9c085b commit 4ad49fc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions app/Http/Controllers/Api/InspectionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,22 @@
*/
class InspectionsController extends Controller
{
/**
api/inspections GET
Show the 'inspections' list with objects reflecting only the general inspection data.
@authenticated
**/
public function index(Request $request)
{
$inspections = $request->user()->allInspections();

if (!isset($inspections))
return response()->json(null, 404);

return response()->json($inspections);
}


/**
api/inspections/lists GET
List checklists and its inspections linked to Hive id. The 'inspections' object contains a descending date ordered list of general inspection data. The 'items_by_date' object contains a list of (rows of) inspection items that can be placed (in columns) under the inspections by created_at date (table format). NB: Use 'Accept-Language' Header (default nl_NL) to provide localized category names (anc, name) in items_by_date.
Expand Down

0 comments on commit 4ad49fc

Please sign in to comment.