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:
James Cole
2024-12-22 08:28:44 +01:00
66 changed files with 234 additions and 195 deletions

View File

@@ -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)
;
}
}