Merge branch '238-activate-all-warranties-for-the-same-plate-number' into 'master'
Resolve "Activate all warranties for the same plate number" Closes #238 See merge request jankstudio/resq!281
This commit is contained in:
commit
bf0cf17962
1 changed files with 3 additions and 8 deletions
|
|
@ -1890,17 +1890,12 @@ class APIController extends Controller
|
|||
return $res->getReturnResponse();
|
||||
}
|
||||
|
||||
// get first entry
|
||||
$warranty = current($warranty_results);
|
||||
if ($warranty->isActivated())
|
||||
// activate all entries
|
||||
foreach ($warranty_results as $warranty)
|
||||
{
|
||||
$res->setError(true)
|
||||
->setErrorMessage('Warranty already activated');
|
||||
return $res->getReturnResponse();
|
||||
$warranty->setActivated();
|
||||
}
|
||||
|
||||
$warranty->setActivated();
|
||||
|
||||
$em->flush();
|
||||
|
||||
return $res->getReturnResponse();
|
||||
|
|
|
|||
Loading…
Reference in a new issue