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

@ -253,13 +253,12 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
*/
#[ORM\OneToMany(mappedBy: 'element', targetEntity: UserAttachment::class, cascade: ['persist', 'remove'], orphanRemoval: true)]
#[ORM\OrderBy(['name' => 'ASC'])]
#[Groups(['user:read'])]
#[ApiProperty(readableLink: false, writableLink: false)]
#[Groups(['user:read', 'user:write'])]
protected Collection $attachments;
#[ORM\ManyToOne(targetEntity: UserAttachment::class)]
#[ORM\JoinColumn(name: 'id_preview_attachment', onDelete: 'SET NULL')]
#[Groups(['user:read'])]
#[Groups(['user:read', 'usser:write'])]
protected ?Attachment $master_picture_attachment = null;
/** @var \DateTimeInterface|null The time when the backup codes were generated