mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-07-01 06:26:15 +00:00
location: filter location api point only by active and availableForUsers
This commit is contained in:
parent
e73179688a
commit
3d5db29a4c
@ -21,22 +21,11 @@ class LocationApiController extends ApiController
|
||||
{
|
||||
public function customizeQuery(string $action, Request $request, $query): void
|
||||
{
|
||||
$query->andWhere($query->expr()->orX(
|
||||
$query->expr()->andX(
|
||||
$query->expr()->eq('e.createdBy', ':user'),
|
||||
$query->expr()->gte('e.createdAt', ':dateBefore')
|
||||
),
|
||||
$query->andWhere(
|
||||
$query->expr()->andX(
|
||||
$query->expr()->eq('e.availableForUsers', "'TRUE'"),
|
||||
$query->expr()->eq('e.active', "'TRUE'"),
|
||||
$query->expr()->isNotNull('e.name'),
|
||||
$query->expr()->neq('e.name', ':emptyString'),
|
||||
)
|
||||
))
|
||||
->setParameters([
|
||||
'user' => $this->getUser(),
|
||||
'dateBefore' => (new DateTime())->sub(new DateInterval('P6M')),
|
||||
'emptyString' => '',
|
||||
]);
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user