Skip to content

Commit

Permalink
fix: add new request structure to field builder first
Browse files Browse the repository at this point in the history
  • Loading branch information
Katalam committed Sep 20, 2024
1 parent fbd1f78 commit d0e2df2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Query/FieldBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Innobrain\OnOfficeAdapter\Enums\OnOfficeAction;
use Innobrain\OnOfficeAdapter\Enums\OnOfficeResourceType;
use Innobrain\OnOfficeAdapter\Exceptions\OnOfficeException;
use Throwable;

class FieldBuilder extends Builder
{
Expand All @@ -33,11 +34,11 @@ public function get(): Collection
}

/**
* @throws OnOfficeException
* @throws Throwable<OnOfficeException>
*/
public function first(): ?array
{
$response = $this->onOfficeService->requestApi(
$request = new OnOfficeRequest(
OnOfficeAction::Get,
OnOfficeResourceType::Fields,
parameters: [
Expand All @@ -46,7 +47,9 @@ public function first(): ?array
],
);

return $response->json('response.results.0.data.records.0');

return $this->requestApi($request)
->json('response.results.0.data.records.0');
}

/**
Expand Down

0 comments on commit d0e2df2

Please sign in to comment.