Checked coupon type before trying to get the service.
This commit is contained in:
@@ -622,16 +622,21 @@ class CouponController extends BaseAdminController
|
|||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->checkXmlHttpRequest();
|
if (! empty($couponServiceId)) {
|
||||||
|
$this->checkXmlHttpRequest();
|
||||||
|
|
||||||
/** @var CouponInterface $coupon */
|
/** @var CouponInterface $coupon */
|
||||||
$couponManager = $this->container->get($couponServiceId);
|
$couponManager = $this->container->get($couponServiceId);
|
||||||
|
|
||||||
if (!$couponManager instanceof CouponInterface) {
|
if (!$couponManager instanceof CouponInterface) {
|
||||||
$this->pageNotFound();
|
$this->pageNotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
$response = new ResponseRest($couponManager->drawBackOfficeInputs());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$response = new ResponseRest('');
|
||||||
}
|
}
|
||||||
|
|
||||||
$response = new ResponseRest($couponManager->drawBackOfficeInputs());
|
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user