Skip to content

Commit 685a9e7

Browse files
committed
update delete response to comply with server
1 parent f9ec20d commit 685a9e7

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

Tests/DeleteModelTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class DeleteModelTest extends PHPUnit_Framework_TestCase
1717
function test_you_can_delete_a_bulletin()
1818
{
1919
$mock = new MockHandler([
20-
new Response(200,[],json_encode(['IsDeleted'=>true]))
20+
new Response(204)
2121
]);
2222
$handler = HandlerStack::create($mock);
2323

src/Requests/APIRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function delete($path)
6262
$this->throwException($e);
6363
}
6464

65-
return $this->parseResponse($response);
65+
return $response;
6666
}
6767

6868
public function upload(string $path, $stream, $params)

src/Server/API.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ public function delete(CarouselModel $model)
9696
];
9797
$request = new APIRequest($this->client, $this->handler, $options);
9898
$response = $request->delete($endpoint);
99-
$model->setProps($response);
99+
if($response->getStatusCode() === 204){
100+
$model->setProps(['IsDeleted'=>true]);
101+
}
100102
return $model;
101103
}
102104

0 commit comments

Comments
 (0)