mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-20 09:09:33 +00:00
Let media_url stay in API attachments responses for backward compatibility
This commit is contained in:
parent
41ae9b5f75
commit
4e3a8022bd
1 changed files with 4 additions and 0 deletions
|
|
@ -57,6 +57,10 @@ class AttachmentNormalizer implements NormalizerInterface, NormalizerAwareInterf
|
|||
//Add thumbnail url if the attachment is a picture
|
||||
$data['thumbnail_url'] = $object->isPicture() ? $this->attachmentURLGenerator->getThumbnailURL($object) : null;
|
||||
|
||||
//For backwards compatibility reasons
|
||||
//Deprecated: Use internal_path and external_path instead
|
||||
$data['media_url'] = $data['internal_path'] ?? $object->getExternalPath();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue