diff --git a/src/Endpoint/Application.php b/src/Endpoint/Application.php index c560d11..3071a26 100644 --- a/src/Endpoint/Application.php +++ b/src/Endpoint/Application.php @@ -93,7 +93,7 @@ public function delete(int $id): bool $response = $this->guzzle->delete($this->endpoint . '/' . $id); $body = $response->getBody()->getContents(); - return $body === '' ? true : false; + return $response->getStatusCode() === 200 ? true : false; } /** diff --git a/src/Endpoint/ApplicationMessage.php b/src/Endpoint/ApplicationMessage.php index fa12689..6180948 100644 --- a/src/Endpoint/ApplicationMessage.php +++ b/src/Endpoint/ApplicationMessage.php @@ -55,6 +55,6 @@ public function deleteAll(int $id): bool $response = $this->guzzle->delete($this->endpoint . '/' . $id . '/message'); $body = $response->getBody()->getContents(); - return $body === '' ? true : false; + return $response->getStatusCode() === 200 ? true : false; } } diff --git a/src/Endpoint/Client.php b/src/Endpoint/Client.php index 3459a66..57a94b9 100644 --- a/src/Endpoint/Client.php +++ b/src/Endpoint/Client.php @@ -89,6 +89,6 @@ public function delete(int $id): bool $response = $this->guzzle->delete($this->endpoint . '/' . $id); $body = $response->getBody()->getContents(); - return $body === '' ? true : false; + return $response->getStatusCode() === 200 ? true : false; } } diff --git a/src/Endpoint/Message.php b/src/Endpoint/Message.php index a137c85..9ea3f24 100644 --- a/src/Endpoint/Message.php +++ b/src/Endpoint/Message.php @@ -113,7 +113,7 @@ public function delete(int $id): bool $response = $this->guzzle->delete($this->endpoint . '/' . $id); $body = $response->getBody()->getContents(); - return $body === '' ? true : false; + return $response->getStatusCode() === 200 ? true : false; } /** @@ -128,6 +128,6 @@ public function deleteAll(): bool $response = $this->guzzle->delete($this->endpoint); $body = $response->getBody()->getContents(); - return $body === '' ? true : false; + return $response->getStatusCode() === 200 ? true : false; } } diff --git a/src/Endpoint/Plugin.php b/src/Endpoint/Plugin.php index cf5cee9..12451c1 100644 --- a/src/Endpoint/Plugin.php +++ b/src/Endpoint/Plugin.php @@ -62,7 +62,7 @@ public function updateConfig(int $id, string $config): bool $response = $this->guzzle->postYaml($this->endpoint . '/' . $id . '/config', $config); $body = $response->getBody()->getContents(); - return $body === '' ? true : false; + return $response->getStatusCode() === 200 ? true : false; } /** @@ -96,7 +96,7 @@ public function enable(int $id): bool $response = $this->guzzle->post($this->endpoint . '/' . $id . '/enable'); $body = $response->getBody()->getContents(); - return $body === '' ? true : false; + return $response->getStatusCode() === 200 ? true : false; } /** @@ -113,6 +113,6 @@ public function disable(int $id): bool $response = $this->guzzle->post($this->endpoint . '/' . $id . '/disable'); $body = $response->getBody()->getContents(); - return $body === '' ? true : false; + return $response->getStatusCode() === 200 ? true : false; } } diff --git a/src/Endpoint/User.php b/src/Endpoint/User.php index 859b394..46824f5 100644 --- a/src/Endpoint/User.php +++ b/src/Endpoint/User.php @@ -50,7 +50,7 @@ public function updatePassword(string $password): bool $response = $this->guzzle->post('current/user/password', $data); $body = $response->getBody()->getContents(); - return $body === '' ? true : false; + return $response->getStatusCode() === 200 ? true : false; } /** @@ -150,6 +150,6 @@ public function delete(int $id): bool $response = $this->guzzle->delete($this->endpoint . '/' . $id); $body = $response->getBody()->getContents(); - return $body === '' ? true : false; + return $response->getStatusCode() === 200 ? true : false; } }