Expand view with several new options. Move cache to api endpoints.

This commit is contained in:
James Cole
2024-04-28 13:30:42 +02:00
parent c1c0afa40b
commit 7992b810fd
10 changed files with 226 additions and 82 deletions

View File

@@ -251,6 +251,7 @@ class AccountRepository implements AccountRepositoryInterface
// process filters
// TODO this should be repeatable, it feels like a hack when you do it here.
// TODO some fields cannot be filtered using the query, and a second filter must be applied on the collection.
foreach($filters as $column => $value) {
// filter on NULL values
if(null === $value) {
@@ -259,6 +260,9 @@ class AccountRepository implements AccountRepositoryInterface
if ('active' === $column) {
$query->where('accounts.active', $value);
}
if('name' === $column) {
$query->where('accounts.name', 'LIKE', sprintf('%%%s%%', $value));
}
}