refactor code

This commit is contained in:
2025-09-21 17:12:19 +00:00
parent c641ec725d
commit 25248e7822
37 changed files with 180 additions and 143 deletions

View File

@@ -34,7 +34,8 @@ class OrderItem extends BaseResource
*/
public function update(array $attributes = []): self
{
return (new self(fn() => $this->billable->request('PUT', sprintf('v1/orders/%s/items/%s', $this->parent->id, $this->id), $attributes)))
return (new self(fn() => $this->billable->anikeenId()
->request('PUT', sprintf('v1/orders/%s/items/%s', $this->parent->id, $this->id), $attributes)))
->setBillable($this->billable)
->setParent($this->parent);
}
@@ -46,6 +47,7 @@ class OrderItem extends BaseResource
*/
public function delete(): bool
{
return $this->billable->request('DELETE', sprintf('v1/orders/%s/items/%s', $this->parent->id, $this->id))->success();
return $this->billable->anikeenId()
->request('DELETE', sprintf('v1/orders/%s/items/%s', $this->parent->id, $this->id))->success();
}
}