Add mqtt send for outlet_assign event #162
This commit is contained in:
parent
4bb2374d66
commit
f720ccd940
1 changed files with 7 additions and 1 deletions
|
|
@ -929,7 +929,7 @@ class JobOrderController extends BaseController
|
|||
return $this->render('job-order/form.html.twig', $params);
|
||||
}
|
||||
|
||||
public function processingSubmit(Request $req, ValidatorInterface $validator, $id)
|
||||
public function processingSubmit(Request $req, ValidatorInterface $validator, MQTTClient $mclient, $id)
|
||||
{
|
||||
$this->denyAccessUnlessGranted('jo_proc.list', null, 'No access.');
|
||||
|
||||
|
|
@ -1018,6 +1018,12 @@ class JobOrderController extends BaseController
|
|||
// validated! save the entity
|
||||
$em->flush();
|
||||
|
||||
// send event to mobile app
|
||||
$payload = [
|
||||
'event' => 'outlet_assign'
|
||||
];
|
||||
$mclient->sendEvent($obj, $payload);
|
||||
|
||||
// return successful response
|
||||
return $this->json([
|
||||
'success' => 'Changes have been saved!'
|
||||
|
|
|
|||
Loading…
Reference in a new issue