diff --git a/Source/Model/ModelAdmin.php b/Source/Model/ModelAdmin.php index 483704a..d4d0c03 100644 --- a/Source/Model/ModelAdmin.php +++ b/Source/Model/ModelAdmin.php @@ -17,7 +17,7 @@ class ModelAdmin private Client $client; public function __construct(){ - $this->client = new Client(); + $this->client = new Client(['headers' => ['Content-Type' => 'application/json'], 'verify' => false]); } public function goToAdmin(): void @@ -42,8 +42,6 @@ class ModelAdmin $questionContent = $_POST['question']; $type = $_POST['type']; try { - - $question = new $type(0, $questionContent); $res = $this->client->request('GET', 'https://codefirst.iut.uca.fr/containers/Temoignages-deploy_api_form/getForm'); if ($res->getStatusCode()!=200){ diff --git a/Source/Model/ModelCandidate.php b/Source/Model/ModelCandidate.php index e0a98bb..aa4e583 100644 --- a/Source/Model/ModelCandidate.php +++ b/Source/Model/ModelCandidate.php @@ -20,7 +20,7 @@ class ModelCandidate private Client $client; public function __construct(){ - $this->client = new Client(); + $this->client = new Client(['headers' => ['Content-Type' => 'application/json'], 'verify' => false]); } /** @@ -32,7 +32,6 @@ class ModelCandidate public function submitForm(): void { $answersAndCategories = $_POST['answers']; - $dataIds = null; if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST['action'] === 'submitForm') { $dataIdsJson = $_POST['data_ids'];