mirror of
https://github.com/diaspora/diaspora.git
synced 2026-01-09 15:18:11 -05:00
Re-add sizes.raw to the photo JSON
because we need it for showing the raw image in the lightbox. This got lost, as the photo extension was made after API development started.
This commit is contained in:
@@ -12,7 +12,8 @@ class PhotoPresenter < BasePresenter
|
||||
sizes: {
|
||||
small: url(:thumb_small),
|
||||
medium: url(:thumb_medium),
|
||||
large: url(:scaled_full)
|
||||
large: url(:scaled_full),
|
||||
raw: url
|
||||
}
|
||||
}
|
||||
end
|
||||
@@ -26,7 +27,8 @@ class PhotoPresenter < BasePresenter
|
||||
sizes: {
|
||||
small: url(:thumb_small),
|
||||
medium: url(:thumb_medium),
|
||||
large: url(:scaled_full)
|
||||
large: url(:scaled_full),
|
||||
raw: url
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -205,11 +205,12 @@
|
||||
"photo_sizes": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"raw": { "$ref": "https://diaspora.software/api/v1/schema.json#/definitions/url" },
|
||||
"large": { "$ref": "https://diaspora.software/api/v1/schema.json#/definitions/url" },
|
||||
"medium": { "$ref": "https://diaspora.software/api/v1/schema.json#/definitions/url" },
|
||||
"small": { "$ref": "https://diaspora.software/api/v1/schema.json#/definitions/url" }
|
||||
},
|
||||
"required": ["large", "medium", "small"],
|
||||
"required": ["raw", "large", "medium", "small"],
|
||||
"additionalProperties": true
|
||||
},
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ describe PhotoPresenter do
|
||||
expect(photo[:sizes][:small]).to be_truthy
|
||||
expect(photo[:sizes][:medium]).to be_truthy
|
||||
expect(photo[:sizes][:large]).to be_truthy
|
||||
expect(photo[:sizes][:raw]).to be_truthy
|
||||
end
|
||||
# rubocop:enable Metrics/AbcSize
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user