Add checking for odometer maximum value. #434
This commit is contained in:
parent
1c076228c6
commit
e8923c8faf
1 changed files with 9 additions and 0 deletions
|
|
@ -1534,6 +1534,15 @@ class CMBRiderAPIHandler implements RiderAPIHandlerInterface
|
||||||
|
|
||||||
$odometer_reading = $req->request->get('odometer');
|
$odometer_reading = $req->request->get('odometer');
|
||||||
|
|
||||||
|
if ($odometer_reading > 999999)
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'title' => 'Failed Set Odometer',
|
||||||
|
'error' => 'Odometer cannot be more than 6 figures.',
|
||||||
|
];
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
$jo->addMeta('odometer', $odometer_reading);
|
$jo->addMeta('odometer', $odometer_reading);
|
||||||
|
|
||||||
$this->em->flush();
|
$this->em->flush();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue