mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-01 22:14:32 +02:00
Allow to create attachments and parameters via PATCH operations on their owning elemens as direct POST operations are not possible yet
This partly fixes issue #502
This commit is contained in:
parent
3548f12deb
commit
7ae0fad356
11 changed files with 11 additions and 11 deletions
|
@ -153,7 +153,7 @@ abstract class Attachment extends AbstractNamedDBElement
|
|||
#[ORM\ManyToOne(targetEntity: AttachmentType::class, inversedBy: 'attachments_with_type')]
|
||||
#[ORM\JoinColumn(name: 'type_id', nullable: false)]
|
||||
#[Selectable()]
|
||||
#[Groups(['attachment:read', 'attachment_write'])]
|
||||
#[Groups(['attachment:read', 'attachment:write'])]
|
||||
protected ?AttachmentType $attachment_type = null;
|
||||
|
||||
#[Groups(['attachment:read'])]
|
||||
|
|
|
@ -66,7 +66,7 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|||
new Delete(security: 'is_granted("delete", object)'),
|
||||
],
|
||||
normalizationContext: ['groups' => ['attachment_type:read', 'api:basic:read'], 'openapi_definition_name' => 'Read'],
|
||||
denormalizationContext: ['groups' => ['attachment_type:write', 'api:basic:write'], 'openapi_definition_name' => 'Write'],
|
||||
denormalizationContext: ['groups' => ['attachment_type:write', 'api:basic:write', 'attachment:write', 'parameter:write'], 'openapi_definition_name' => 'Write'],
|
||||
)]
|
||||
#[ApiResource(
|
||||
uriTemplate: '/attachment_types/{id}/children.{_format}',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue