Add limit param to all endpoints

This commit is contained in:
James Cole
2023-10-05 18:52:01 +02:00
parent a29d056a9b
commit 664a08d42f
46 changed files with 136 additions and 138 deletions

View File

@@ -43,10 +43,11 @@ class ListRequest extends FormRequest
/**
* @return string
*/
public function buildParams(): string
public function buildParams(int $pageSize): string
{
$array = [
'page' => $this->getPage(),
'page' => $this->getPage(),
'limit' => $pageSize,
];
$start = $this->getStartDate();
@@ -55,9 +56,6 @@ class ListRequest extends FormRequest
$array['start'] = $start->format('Y-m-d');
$array['end'] = $end->format('Y-m-d');
}
if (0 !== $this->getLimit()) {
$array['limit'] = $this->getLimit();
}
return http_build_query($array);
}
@@ -86,14 +84,6 @@ class ListRequest extends FormRequest
return $this->getCarbonDate('end');
}
/**
* @return int
*/
public function getLimit(): int
{
return $this->convertInteger('limit');
}
/**
* @return array
*/