Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
awallef committed May 21, 2021
1 parent c5f403e commit fdd7c93
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Webservice/ClickUpWebservice.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ protected function _executeReadQuery(Query $query, array $options = [])
// If this is the case turn search of
$search = false;
}

if ($search) {
$url = '/search' . $url;

Expand Down Expand Up @@ -129,11 +129,11 @@ protected function _write(Query $query, array $options = [])
switch ($query->action())
{
case Query::ACTION_CREATE:
$response = $this->driver()->client()->post($url, $query->set());
$response = $this->driver()->client()->post($url, json_encode($query->set()));
break;

case Query::ACTION_UPDATE:
$response = $this->driver()->client()->put($url, $query->set());
$response = $this->driver()->client()->put($url, json_encode($query->set()));
break;

case Query::ACTION_DELETE:
Expand Down
5 changes: 4 additions & 1 deletion src/Webservice/Driver/ClickUp.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ public function initialize()
$this->client(new Client([
'host' => 'api.clickup.com',
'scheme' => 'https',
'headers' => ['Authorization' => $this->getConfig('token')]
'headers' => [
'Authorization' => $this->getConfig('token'),
'Content-Type' => 'application/json'
]
]));
}
}

0 comments on commit fdd7c93

Please sign in to comment.