Skip to content

Commit 5f643cf

Browse files
committed
Fix response to object for create operations
1 parent 97f4b9c commit 5f643cf

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

src/Operations/Create.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@
88
trait Create
99
{
1010

11-
public function create(array $data, array $additionalData = [])
11+
public function create(array $data)
1212
{
1313
$data = $this->objectToPayload($data);
1414

15-
return $this->client->post(
15+
$response = $this->client->post(
1616
$this->path(),
1717
$data
1818
);
19+
20+
return $this->payloadToObject($response);
1921
}
2022

2123
}

src/Operations/Delete.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ trait Delete
1010

1111
public function delete(int $id)
1212
{
13-
return $this->client->delete(
13+
$response = $this->client->delete(
1414
$this->path($id)
1515
);
16+
17+
return $this->payloadToObject($response);
1618
}
1719

1820
}

src/Operations/Get.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ trait Get
1010

1111
public function get(int $id)
1212
{
13-
return $this->payloadToObject(
14-
$this->client->get(
15-
$this->path($id)
16-
)
13+
$response = $this->client->get(
14+
$this->path($id)
1715
);
16+
17+
return $this->payloadToObject($response);
1818
}
1919

2020
}

0 commit comments

Comments
 (0)