Skip to content

Commit

Permalink
Add date filtering for external presence
Browse files Browse the repository at this point in the history
  • Loading branch information
froozeify committed Mar 1, 2024
1 parent bcd0bf7 commit 6add6e2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Entity/ExternalPresence.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace App\Entity;

use ApiPlatform\Doctrine\Orm\Filter\DateFilter;
use ApiPlatform\Doctrine\Orm\Filter\OrderFilter;
use ApiPlatform\Metadata\ApiFilter;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\GetCollection;
use ApiPlatform\Metadata\Patch;
Expand Down Expand Up @@ -42,6 +45,8 @@
'groups' => ['external-presence', 'external-presence-write']
]
)]
#[ApiFilter(DateFilter::class, properties: ['date' => DateFilter::EXCLUDE_NULL])]
#[ApiFilter(OrderFilter::class, properties: ['date' => 'DESC'])]
class ExternalPresence {
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'SEQUENCE')]
Expand Down

0 comments on commit 6add6e2

Please sign in to comment.