Activate all warranties found for a plate number. #238
This commit is contained in:
parent
74740f6228
commit
6655869c4f
1 changed files with 3 additions and 8 deletions
|
|
@ -1890,17 +1890,12 @@ class APIController extends Controller
|
||||||
return $res->getReturnResponse();
|
return $res->getReturnResponse();
|
||||||
}
|
}
|
||||||
|
|
||||||
// get first entry
|
// activate all entries
|
||||||
$warranty = current($warranty_results);
|
foreach ($warranty_results as $warranty)
|
||||||
if ($warranty->isActivated())
|
|
||||||
{
|
{
|
||||||
$res->setError(true)
|
$warranty->setActivated();
|
||||||
->setErrorMessage('Warranty already activated');
|
|
||||||
return $res->getReturnResponse();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$warranty->setActivated();
|
|
||||||
|
|
||||||
$em->flush();
|
$em->flush();
|
||||||
|
|
||||||
return $res->getReturnResponse();
|
return $res->getReturnResponse();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue