mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-04 07:09:14 +00:00
Update ImageSerializer with missing image size urls: mini/thumb_url, product/image_url that is used in the product image modal
This commit is contained in:
@@ -1,10 +1,18 @@
|
||||
class Api::ImageSerializer < ActiveModel::Serializer
|
||||
attributes :id, :alt, :small_url, :large_url
|
||||
attributes :id, :alt, :thumb_url, :small_url, :image_url, :large_url
|
||||
|
||||
def thumb_url
|
||||
object.attachment.url(:mini, false)
|
||||
end
|
||||
|
||||
def small_url
|
||||
object.attachment.url(:small, false)
|
||||
end
|
||||
|
||||
def image_url
|
||||
object.attachment.url(:product, false)
|
||||
end
|
||||
|
||||
def large_url
|
||||
object.attachment.url(:large, false)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user