mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-06 02:21:25 +00:00
Merge branch 'v6.2' of github.com:firefly-iii/firefly-iii into v6.2
# Conflicts: # app/Api/V2/Controllers/Model/ExchangeRate/ShowController.php # app/Repositories/UserGroups/ExchangeRate/ExchangeRateRepository.php # routes/api.php
This commit is contained in:
@@ -37,8 +37,8 @@ use Illuminate\Pagination\LengthAwarePaginator;
|
||||
*/
|
||||
class ShowController extends Controller
|
||||
{
|
||||
public const string RESOURCE_KEY = 'exchange-rates';
|
||||
use ValidatesUserGroupTrait;
|
||||
public const string RESOURCE_KEY = 'exchange-rates';
|
||||
|
||||
private ExchangeRateRepositoryInterface $repository;
|
||||
|
||||
@@ -61,7 +61,6 @@ class ShowController extends Controller
|
||||
$page = $this->parameters->get('page');
|
||||
$rates = $this->repository->getRates($from, $to);
|
||||
$count = $rates->count();
|
||||
|
||||
$rates = $rates->slice(($page - 1) * $pageSize, $pageSize);
|
||||
$paginator = new LengthAwarePaginator($rates, $count, $pageSize, $page);
|
||||
|
||||
@@ -70,6 +69,7 @@ class ShowController extends Controller
|
||||
|
||||
return response()
|
||||
->json($this->jsonApiList(self::RESOURCE_KEY, $paginator, $transformer))
|
||||
->header('Content-Type', self::CONTENT_TYPE);
|
||||
->header('Content-Type', self::CONTENT_TYPE)
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user