Activate all warranties found for a plate number. #238

This commit is contained in:
Korina Cordero 2019-07-31 02:19:46 +00:00
parent 74740f6228
commit 6655869c4f

View file

@ -1890,16 +1890,11 @@ 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)
->setErrorMessage('Warranty already activated');
return $res->getReturnResponse();
}
$warranty->setActivated(); $warranty->setActivated();
}
$em->flush(); $em->flush();