Closed faustbrian closed 10 months ago
This seems to do the trick, didn't think of checking if HasJsonBody
is used. Though it doesn't seem to be possible to set nested keys via dot-notation so merge
has to be used.
protected function applyPagination(Request $request): Request
{
if (!\in_array(HasJsonBody::class, \class_uses($request), true)) {
return $request;
}
if ($this->currentResponse instanceof Response) {
// @phpstan-ignore-next-line
$request->body()->merge([
'params' => [
'page' => [
'cursor' => $this->getNextCursor($this->currentResponse),
'size' => $this->perPageLimit,
],
],
]);
}
return $request;
}
Hey, is it currently possible to create a paginator that adds parameters to the body instead of headers and query? I would basically need a slightly adjusted version of what is shown on this page.