Support pagination of server backups, closes #2787
This commit is contained in:
parent
8a97b73a6c
commit
a8d9eccf9c
6 changed files with 53 additions and 22 deletions
|
@ -60,7 +60,8 @@ class BackupController extends ClientApiController
|
|||
*/
|
||||
public function index(GetBackupsRequest $request, Server $server)
|
||||
{
|
||||
return $this->fractal->collection($server->backups()->paginate(20))
|
||||
$limit = min($request->query('per_page') ?? 20, 50);
|
||||
return $this->fractal->collection($server->backups()->paginate($limit))
|
||||
->transformWith($this->getTransformer(BackupTransformer::class))
|
||||
->toArray();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue