mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-15 14:49:33 +00:00
Allow to create Attachments for all entity types using the API
This fixes issue #502
This commit is contained in:
parent
16b3d58242
commit
ce768764cc
14 changed files with 47 additions and 9 deletions
|
|
@ -46,7 +46,6 @@ class PartAttachment extends Attachment
|
|||
*/
|
||||
#[ORM\ManyToOne(targetEntity: Part::class, inversedBy: 'attachments')]
|
||||
#[ORM\JoinColumn(name: 'element_id', nullable: false, onDelete: 'CASCADE')]
|
||||
// Set the correct type for the element property to use
|
||||
#[Context(denormalizationContext: [OverrideClassDenormalizer::CONTEXT_KEY => Part::class])]
|
||||
#[Context(denormalizationContext: [OverrideClassDenormalizer::CONTEXT_KEY => self::ALLOWED_ELEMENT_CLASS])]
|
||||
protected ?AttachmentContainingDBElement $element = null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue