Merge branch 'fronkdev' into 'master'
change Citycom OAN Api Helper updateService() to get only single service before update See merge request fronk/thetool!2091
This commit is contained in:
@@ -177,6 +177,33 @@ class Citycom_OanApiClient {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getService($service_id) {
|
||||||
|
if(!$this->token) {
|
||||||
|
$this->getAuthToken();
|
||||||
|
if(!$this->token) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//$url = $this->baseurl.CITYCOM_OAN_API_EP_GET_SERVICES;
|
||||||
|
$url = str_replace("{service_id}", $service_id, $this->baseurl.CITYCOM_OAN_API_EP_GET_SERVICE);
|
||||||
|
|
||||||
|
$ctx_options = [
|
||||||
|
"http" => [
|
||||||
|
"ignore_errors" => true,
|
||||||
|
"method" => "GET",
|
||||||
|
"header" => [
|
||||||
|
"Accept: application/json",
|
||||||
|
"Authorization: Bearer ".$this->token,
|
||||||
|
],
|
||||||
|
]
|
||||||
|
];
|
||||||
|
|
||||||
|
$service = $this->runApiRequest($url, $ctx_options);
|
||||||
|
return $service;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public function createService($data) {
|
public function createService($data) {
|
||||||
if(!$this->token) {
|
if(!$this->token) {
|
||||||
$this->getAuthToken();
|
$this->getAuthToken();
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ class Citycom_OanApiHelper {
|
|||||||
*/
|
*/
|
||||||
public function updateService($service_ext_id, $data) {
|
public function updateService($service_ext_id, $data) {
|
||||||
// get service and compare data
|
// get service and compare data
|
||||||
$services = $this->api->getServices();
|
/*$services = $this->api->getServices();
|
||||||
if(!$services) {
|
if(!$services) {
|
||||||
$this->log->error(__METHOD__.": Error getting services.");
|
$this->log->error(__METHOD__.": Error getting services.");
|
||||||
return false;
|
return false;
|
||||||
@@ -288,7 +288,9 @@ class Citycom_OanApiHelper {
|
|||||||
$service = $cc_service;
|
$service = $cc_service;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
$service = $this->api->getService($service_ext_id);
|
||||||
|
|
||||||
if(!$service) {
|
if(!$service) {
|
||||||
$this->log->error(__METHOD__.": Service not available.");
|
$this->log->error(__METHOD__.": Service not available.");
|
||||||
|
|||||||
Reference in New Issue
Block a user