Improve make request in nano health controller
This commit is contained in:
parent
bf82aea154
commit
eca79fcabb
|
@ -409,7 +409,10 @@ class NanoHealthController extends CI_Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
private function makeRequest($method , $path , $request_body = []){
|
private function makeRequest($method , $path , $request_body = []){
|
||||||
if($this->isLogged()) {
|
if(!$this->isLogged()) {
|
||||||
|
return json_encode(['status' => 500]);
|
||||||
|
}
|
||||||
|
|
||||||
$url = NANO_SANTE_SERVICE_URL.$path;
|
$url = NANO_SANTE_SERVICE_URL.$path;
|
||||||
$ch = curl_init($url);
|
$ch = curl_init($url);
|
||||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
|
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
|
||||||
|
@ -434,10 +437,10 @@ class NanoHealthController extends CI_Controller
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}else{
|
||||||
}
|
|
||||||
return json_encode(['status' => 500]);
|
return json_encode(['status' => 500]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function storeExclusions(){
|
public function storeExclusions(){
|
||||||
if($this->isLogged()) {
|
if($this->isLogged()) {
|
||||||
|
|
Loading…
Reference in New Issue