Fix generate url inside rider api handler #472
This commit is contained in:
parent
01f5717c1c
commit
678dfcc65d
1 changed files with 6 additions and 2 deletions
|
|
@ -5,6 +5,7 @@ namespace App\Service\RiderAPIHandler;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface;
|
use Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface;
|
||||||
|
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||||
|
|
||||||
use App\Ramcar\CMBServiceType;
|
use App\Ramcar\CMBServiceType;
|
||||||
use App\Ramcar\TradeInType;
|
use App\Ramcar\TradeInType;
|
||||||
|
|
@ -55,13 +56,15 @@ class CMBRiderAPIHandler implements RiderAPIHandlerInterface
|
||||||
protected $session;
|
protected $session;
|
||||||
protected $upload_dir;
|
protected $upload_dir;
|
||||||
protected $nm;
|
protected $nm;
|
||||||
|
protected $router;
|
||||||
|
|
||||||
public function __construct(EntityManagerInterface $em, RedisClientProvider $redis,
|
public function __construct(EntityManagerInterface $em, RedisClientProvider $redis,
|
||||||
EncoderFactoryInterface $ef, RiderCache $rcache,
|
EncoderFactoryInterface $ef, RiderCache $rcache,
|
||||||
string $country_code, MQTTClient $mclient,
|
string $country_code, MQTTClient $mclient,
|
||||||
WarrantyHandler $wh, JobOrderHandlerInterface $jo_handler,
|
WarrantyHandler $wh, JobOrderHandlerInterface $jo_handler,
|
||||||
InvoiceGeneratorInterface $ic, string $upload_dir,
|
InvoiceGeneratorInterface $ic, string $upload_dir,
|
||||||
RiderTracker $rider_tracker, NotificationManager $nm)
|
RiderTracker $rider_tracker, NotificationManager $nm,
|
||||||
|
UrlGeneratorInterface $router)
|
||||||
{
|
{
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
$this->redis = $redis;
|
$this->redis = $redis;
|
||||||
|
|
@ -75,6 +78,7 @@ class CMBRiderAPIHandler implements RiderAPIHandlerInterface
|
||||||
$this->upload_dir = $upload_dir;
|
$this->upload_dir = $upload_dir;
|
||||||
$this->rider_tracker = $rider_tracker;
|
$this->rider_tracker = $rider_tracker;
|
||||||
$this->nm = $nm;
|
$this->nm = $nm;
|
||||||
|
$this->router = $router;
|
||||||
|
|
||||||
// one device = one session, since we have control over the devices
|
// one device = one session, since we have control over the devices
|
||||||
// when a rider logs in, we just change the rider assigned to the device
|
// when a rider logs in, we just change the rider assigned to the device
|
||||||
|
|
@ -1157,7 +1161,7 @@ class CMBRiderAPIHandler implements RiderAPIHandlerInterface
|
||||||
|
|
||||||
$this->mclient->publish($channel, $rider_status);
|
$this->mclient->publish($channel, $rider_status);
|
||||||
|
|
||||||
$notif_url = $this->generateUrl('jo_onestep_edit_form', ['id' => $jo->getID()]);
|
$notif_url = $this->router->generate('jo_onestep_edit_form', ['id' => $jo->getID()]);
|
||||||
$this->nm->sendNotification(0, 'Job order has been rejected by rider.', $notif_url);
|
$this->nm->sendNotification(0, 'Job order has been rejected by rider.', $notif_url);
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue