Show attachments and preview image in API response

This commit is contained in:
Jan Böhmer 2023-09-18 23:38:06 +02:00
parent 1823bc6528
commit 87e881f8e0
7 changed files with 18 additions and 14 deletions

View file

@ -152,14 +152,14 @@ class Category extends AbstractPartsContainingDBElement
* @var Collection<int, CategoryAttachment>
*/
#[Assert\Valid]
#[Groups(['full', 'category:read'])]
#[Groups(['full', 'category:read', 'category:write'])]
#[ORM\OneToMany(targetEntity: CategoryAttachment::class, mappedBy: 'element', cascade: ['persist', 'remove'], orphanRemoval: true)]
#[ORM\OrderBy(['name' => 'ASC'])]
protected Collection $attachments;
#[ORM\ManyToOne(targetEntity: CategoryAttachment::class)]
#[ORM\JoinColumn(name: 'id_preview_attachment', onDelete: 'SET NULL')]
#[Groups(['category:read'])]
#[Groups(['category:read', 'category:write'])]
protected ?Attachment $master_picture_attachment = null;
/** @var Collection<int, CategoryParameter>