Skip to content

Commit

Permalink
Merge pull request #11 from productflowbv/features/kaufland-v2
Browse files Browse the repository at this point in the history
Add encode body before sending
  • Loading branch information
jeroensurft authored Jan 10, 2023
2 parents 99ddc35 + e92fadb commit 39e303c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public function request(string $method, string $uri, array $options = [])

if (! empty($options['body'])) {
$body = json_encode($options['body']);
$options['body'] = json_encode($options['body']);
}

$header = [
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/Unit.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function show($identifier): array
*/
public function create(array $attributes): array
{
return $this->connection->request('POST', 'units', ['body' => $attributes]);
return $this->connection->request('POST', 'units', ['body' => $attributes, 'query' => $this->getQuery()]);
}

/**
Expand All @@ -41,7 +41,7 @@ public function create(array $attributes): array
*/
public function update($identifier, array $attributes): array
{
return $this->connection->request('PATCH', "units/{$identifier}", ['body' => $attributes]);
return $this->connection->request('PATCH', "units/{$identifier}", ['body' => $attributes, 'query' => $this->getQuery()]);
}

/**
Expand Down

0 comments on commit 39e303c

Please sign in to comment.