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

@ -62,7 +62,6 @@ use LogicException;
#[ORM\Index(name: 'attachments_idx_class_name_id', columns: ['class_name', 'id'])]
#[ORM\Index(name: 'attachment_name_idx', columns: ['name'])]
#[ORM\Index(name: 'attachment_element_idx', columns: ['class_name', 'element_id'])]
#[ApiResource(
operations: [
new Get(security: 'is_granted("read", object)'),
@ -128,7 +127,7 @@ abstract class Attachment extends AbstractNamedDBElement
* ORM mapping is done in subclasses (like PartAttachment).
* @phpstan-param T|null $element
*/
#[Groups(['attachment:read:standalone', 'attachment:read'])]
#[Groups(['attachment:read:standalone', 'attachment:write'])]
protected ?AttachmentContainingDBElement $element = null;
#[ORM\Column(type: Types::BOOLEAN)]