Allow JSON media type + POST for Building (WIP)
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Entity;
|
||||
|
||||
use ApiPlatform\Metadata\ApiResource;
|
||||
use ApiPlatform\Metadata\Get;
|
||||
use ApiPlatform\Metadata\Post;
|
||||
use ApiPlatform\Metadata\GetCollection;
|
||||
use App\Repository\BuildingRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
@@ -14,7 +15,9 @@ use Symfony\Component\Serializer\Attribute\Groups;
|
||||
#[ApiResource(
|
||||
operations: [
|
||||
new Get(normalizationContext: ['groups' => 'building:item']),
|
||||
new GetCollection(normalizationContext: ['groups' => 'building:list'])
|
||||
new GetCollection(normalizationContext: ['groups' => 'building:list']),
|
||||
// TODO Security!!
|
||||
new Post(),
|
||||
],
|
||||
order: ['name' => 'DESC'],
|
||||
paginationEnabled: false,
|
||||
|
||||
Reference in New Issue
Block a user