Merge pull request #347 from hargata/Hargata/max.odo.api

Added API Endpoint to retrieve last reported odometer reading.
This commit is contained in:
Hargata Softworks
2024-02-28 20:13:18 -07:00
committed by GitHub
2 changed files with 22 additions and 0 deletions

View File

@@ -341,6 +341,14 @@ namespace CarCareTracker.Controllers
}
[TypeFilter(typeof(CollaboratorFilter))]
[HttpGet]
[Route("/api/vehicle/odometerrecords/latest")]
public IActionResult LastOdometer(int vehicleId)
{
var result = GetMaxMileage(vehicleId);
return Json(result);
}
[TypeFilter(typeof(CollaboratorFilter))]
[HttpGet]
[Route("/api/vehicle/odometerrecords")]
public IActionResult OdometerRecords(int vehicleId)
{

View File

@@ -285,6 +285,20 @@
vehicleId - Id of Vehicle
</div>
</div>
<div class="row">
<div class="col-1">
GET
</div>
<div class="col-5">
<code>/api/vehicle/odometerrecords/latest</code>
</div>
<div class="col-3">
Returns last reported odometer for the vehicle
</div>
<div class="col-3">
vehicleId - Id of Vehicle
</div>
</div>
<div class="row">
<div class="col-1">
POST