GET /assessment/:assessment_id/
Result:
{
...
"images": [
{
"id": 3,
"featured": true || false, # Only one image can be featured
"note": "...",
"url": "...",
"width": 350,
"height": 600,
"thumbnail_url": "..."
"thumbnail_width": 350,
"thumbnail_height": 600,
},
{ ... }
]
}
POST /assessment/:assessment_id/featured-image
(set_featured_image
)
Request:
{ "id": 7 }
POST /assessment/:assessment_id/images/
(upload_image
)
Request: Contains single multipart-encoded file
DELETE /images/:image_id/
(delete_image
)
Great, I've taken on everything you suggested! That's really useful, thanks.
I've changed the 'set featured image' functionality to be a separate endpoint - does it look better to you? I was umming and ahhing about this for a while on Friday. I thought it was more RESTful to have the featured image be PATCHable, but I think it would be messy to implement it with the flatter image data structure (which I agree does make more sense!)