Skip to content

Commit

Permalink
Return consistent responses from all traits
Browse files Browse the repository at this point in the history
  • Loading branch information
KFoobar committed Feb 16, 2023
1 parent c6ae039 commit 34f011e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Traits/HasDelete.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public function delete(mixed $id): mixed
{
$endpoint = sprintf('%s/%s', $this->endpoint, $id);

return $this->client->delete($endpoint);
$response = $this->client->delete($endpoint);

return $response->json();
}
}
4 changes: 3 additions & 1 deletion src/Traits/HasUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public function update(mixed $id, array $data): mixed
{
$endpoint = sprintf('%s/%s', $this->endpoint, $id);

return $this->client->put($endpoint, $data);
$response = $this->client->put($endpoint, $data);

return $response->json();
}
}

0 comments on commit 34f011e

Please sign in to comment.