updated new iframe
This commit is contained in:
@@ -38,6 +38,27 @@ class PreorderIFrameController extends mfBaseController
|
||||
self::returnJson(['clusters' => $this->preorderIFrameModel->getClusters($_SERVER['HTTP_X_FRAME_REFERRER'])]);
|
||||
}
|
||||
|
||||
public function getClusterInfoAction()
|
||||
{
|
||||
$clusterId = $this->request->get('cluster_id');
|
||||
if (!$clusterId) self::sendError("Cluster ID is required.");
|
||||
|
||||
$allClusters = $this->preorderIFrameModel->getClusters($_SERVER['HTTP_X_FRAME_REFERRER']);
|
||||
if (!$allClusters) self::sendError("No cluster found for the given ID.");
|
||||
|
||||
$clusterInfo = null;
|
||||
foreach ($allClusters as $cluster) {
|
||||
if ($cluster['id'] == $clusterId) {
|
||||
$clusterInfo = $cluster;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$preorderCampaign = new Preordercampaign($clusterInfo['campaign_id']);
|
||||
|
||||
self::returnJson(['iframe_consents' => json_decode($preorderCampaign->iframe_consents ?? '[]')]);
|
||||
}
|
||||
|
||||
public function findCityAction()
|
||||
{
|
||||
$allowedClusters = $this->preorderIFrameModel->getClusters($_SERVER['HTTP_X_FRAME_REFERRER']);
|
||||
|
||||
Reference in New Issue
Block a user