From e588ba7efbe762e3df69129a7aebce2678ae805a Mon Sep 17 00:00:00 2001 From: Edson Alves Date: Mon, 9 Nov 2020 09:33:29 -0300 Subject: [PATCH] fix --- src/DigiSacClient.php | 3 ++- src/Traits/ContactTrait.php | 4 ++-- src/Traits/DepartmentTrait.php | 4 ++-- src/Traits/OrganizationTrait.php | 4 ++-- src/Traits/PersonTrait.php | 4 ++-- src/Traits/ServiceTrait.php | 4 ++-- src/Traits/TagTrait.php | 4 ++-- src/Traits/TicketTopicTrait.php | 4 ++-- src/Traits/UserTrait.php | 4 ++-- 9 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/DigiSacClient.php b/src/DigiSacClient.php index 8ccfac6..85e3d9c 100644 --- a/src/DigiSacClient.php +++ b/src/DigiSacClient.php @@ -95,7 +95,8 @@ public function getBaseBotUrlEnd() */ public function prepareRequest(DigiSacRequest $request) { - $url = $this->getBaseBotUrlBegin().$request->getUrl().$this->getBaseBotUrlEnd().'/'.$request->getEndpoint(); + //$url = $this->getBaseBotUrlBegin().$request->getUrl().$this->getBaseBotUrlEnd().'/'.$request->getEndpoint(); + $url = $request->getUrl().'/'.$request->getEndpoint(); return [ $url, diff --git a/src/Traits/ContactTrait.php b/src/Traits/ContactTrait.php index 7235a8c..e2aba1b 100644 --- a/src/Traits/ContactTrait.php +++ b/src/Traits/ContactTrait.php @@ -22,7 +22,7 @@ public function getContact(array $url_token, $id, array $params) return new Contact($response->getDecodedBody()); } - public function addContact(array $url_token, $id, array $params) + public function addContact(array $url_token, array $params) { if (!empty($url_token)) { $this->url_token = $url_token; @@ -39,7 +39,7 @@ public function updateContact(array $url_token, $id, array $params) $this->url_token = $url_token; } - $response = $this->put('contacts', $params); + $response = $this->put('contacts/'.$id, $params); return new Contact($response->getDecodedBody()); } diff --git a/src/Traits/DepartmentTrait.php b/src/Traits/DepartmentTrait.php index 542b1a8..88ae1d7 100644 --- a/src/Traits/DepartmentTrait.php +++ b/src/Traits/DepartmentTrait.php @@ -18,7 +18,7 @@ public function getDepartment(array $url_token, $id, array $params) return new Department($response->getDecodedBody()); } - public function addDepartment(array $url_token, $id, array $params) + public function addDepartment(array $url_token, array $params) { if (!empty($url_token)) { $this->url_token = $url_token; @@ -35,7 +35,7 @@ public function updateDepartment(array $url_token, $id, array $params) $this->url_token = $url_token; } - $response = $this->put('departments', $params); + $response = $this->put('departments/'.$id, $params); return new Department($response->getDecodedBody()); } diff --git a/src/Traits/OrganizationTrait.php b/src/Traits/OrganizationTrait.php index e647663..686d1ec 100644 --- a/src/Traits/OrganizationTrait.php +++ b/src/Traits/OrganizationTrait.php @@ -18,7 +18,7 @@ public function getOrganization(array $url_token, $id, array $params) return new Organization($response->getDecodedBody()); } - public function addOrganization(array $url_token, $id, array $params) + public function addOrganization(array $url_token, array $params) { if (!empty($url_token)) { $this->url_token = $url_token; @@ -35,7 +35,7 @@ public function updateOrganization(array $url_token, $id, array $params) $this->url_token = $url_token; } - $response = $this->put('organizations', $params); + $response = $this->put('organizations/'.$id, $params); return new Organization($response->getDecodedBody()); } diff --git a/src/Traits/PersonTrait.php b/src/Traits/PersonTrait.php index 38d4e32..6f45c05 100644 --- a/src/Traits/PersonTrait.php +++ b/src/Traits/PersonTrait.php @@ -18,7 +18,7 @@ public function getPerson(array $url_token, $id, array $params) return new Person($response->getDecodedBody()); } - public function addPerson(array $url_token, $id, array $params) + public function addPerson(array $url_token, array $params) { if (!empty($url_token)) { $this->url_token = $url_token; @@ -35,7 +35,7 @@ public function updatePerson(array $url_token, $id, array $params) $this->url_token = $url_token; } - $response = $this->put('people', $params); + $response = $this->put('people/'.$id, $params); return new Person($response->getDecodedBody()); } diff --git a/src/Traits/ServiceTrait.php b/src/Traits/ServiceTrait.php index 67b3562..c43e16c 100644 --- a/src/Traits/ServiceTrait.php +++ b/src/Traits/ServiceTrait.php @@ -28,7 +28,7 @@ public function getService(array $url_token, $id, array $params) return new Service($response->getDecodedBody()); } - public function addService(array $url_token, $id, array $params) + public function addService(array $url_token, array $params) { if (!empty($url_token)) { $this->url_token = $url_token; @@ -45,7 +45,7 @@ public function updateService(array $url_token, $id, array $params) $this->url_token = $url_token; } - $response = $this->put('services', $params); + $response = $this->put('services/'.$id, $params); return new Service($response->getDecodedBody()); } diff --git a/src/Traits/TagTrait.php b/src/Traits/TagTrait.php index 3959408..5aa2e06 100644 --- a/src/Traits/TagTrait.php +++ b/src/Traits/TagTrait.php @@ -18,7 +18,7 @@ public function getTag(array $url_token, $id, array $params) return new Tag($response->getDecodedBody()); } - public function addTag(array $url_token, $id, array $params) + public function addTag(array $url_token, array $params) { if (!empty($url_token)) { $this->url_token = $url_token; @@ -35,7 +35,7 @@ public function updateTag(array $url_token, $id, array $params) $this->url_token = $url_token; } - $response = $this->put('tags', $params); + $response = $this->put('tags/'.$id, $params); return new Tag($response->getDecodedBody()); } diff --git a/src/Traits/TicketTopicTrait.php b/src/Traits/TicketTopicTrait.php index e93c9f5..957505d 100644 --- a/src/Traits/TicketTopicTrait.php +++ b/src/Traits/TicketTopicTrait.php @@ -18,7 +18,7 @@ public function getTicketTopic(array $url_token, $id, array $params) return new TicketTopic($response->getDecodedBody()); } - public function addTicketTopic(array $url_token, $id, array $params) + public function addTicketTopic(array $url_token, array $params) { if (!empty($url_token)) { $this->url_token = $url_token; @@ -35,7 +35,7 @@ public function updateTicketTopic(array $url_token, $id, array $params) $this->url_token = $url_token; } - $response = $this->put('ticket-topics', $params); + $response = $this->put('ticket-topics/'.$id, $params); return new TicketTopic($response->getDecodedBody()); } diff --git a/src/Traits/UserTrait.php b/src/Traits/UserTrait.php index 71623ae..bba5d1c 100644 --- a/src/Traits/UserTrait.php +++ b/src/Traits/UserTrait.php @@ -31,7 +31,7 @@ public function getUser(array $url_token, $id, array $params) return new User($response->getDecodedBody()); } - public function addUser(array $url_token, $id, array $params) + public function addUser(array $url_token, array $params) { if (!empty($url_token)) { $this->url_token = $url_token; @@ -48,7 +48,7 @@ public function updateUser(array $url_token, $id, array $params) $this->url_token = $url_token; } - $response = $this->put('users', $params); + $response = $this->put('users/'.$id, $params); return new User($response->getDecodedBody()); }