|
|
@@ -70,7 +70,7 @@ class DolibarrService
|
|
|
$organization->getId()
|
|
|
);
|
|
|
|
|
|
- return $this->request("api/index.php/thirdparties",'POST', $body);
|
|
|
+ return $this->request("api/index.php/thirdparties",'POST', ['body' => $body]);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -79,23 +79,13 @@ class DolibarrService
|
|
|
*
|
|
|
* @param string $path
|
|
|
* @param string $method
|
|
|
- * @param string|null $body
|
|
|
+ * @param array $options
|
|
|
* @return array
|
|
|
* @throws NotFoundHttpException
|
|
|
*/
|
|
|
- private function request(string $path, string $method = 'GET', string $body = ''): array
|
|
|
+ private function request(string $path, string $method = 'GET', array $options = []): array
|
|
|
{
|
|
|
try {
|
|
|
- $options = [
|
|
|
- 'headers' => [
|
|
|
- 'Accept'=> 'application/json',
|
|
|
- 'DOLAPIKEY' => 'Bocc4zC0J186v8J6QCqu7DnoIw4I7mCJ'
|
|
|
- ]
|
|
|
- ];
|
|
|
-
|
|
|
- if ($body !== null) {
|
|
|
- $options['body'] = $body;
|
|
|
- }
|
|
|
$uri = ltrim($path, '/');
|
|
|
$response = $this->client->request($method, $uri, $options);
|
|
|
return json_decode($response->getContent(), true);
|