forked from lubiana/futtern
added a /api/food_orders/latest/ endpoint to recieve the latest food order
This commit is contained in:
parent
ee32852789
commit
300c8cafc9
4 changed files with 64 additions and 0 deletions
|
@ -10,6 +10,7 @@ use ApiPlatform\Metadata\Post;
|
|||
use ApiPlatform\Metadata\Put;
|
||||
use App\Repository\FoodOrderRepository;
|
||||
use App\State\OpenOrdersProvider;
|
||||
use App\State\LatestOrderProvider;
|
||||
use DateInterval;
|
||||
use DateTimeImmutable;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
@ -27,6 +28,11 @@ use function iterator_to_array;
|
|||
description: 'Get only open orders',
|
||||
provider: OpenOrdersProvider::class,
|
||||
),
|
||||
new GetCollection(
|
||||
uriTemplate: 'food_orders/latest',
|
||||
description: 'Get the latest created order',
|
||||
provider: LatestOrderProvider::class,
|
||||
),
|
||||
new GetCollection,
|
||||
new Get,
|
||||
new Post,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue