mysociety / popit

DEPRECATED - Development on PopIt has stopped and it is no longer being maintained
https://goo.gl/Vvej4Q
Other
76 stars 33 forks source link

when POSTing a new image, there should be a parameter to say "put this first in images" #796

Closed mhl closed 9 years ago

mhl commented 9 years ago

At the moment, if you POST an image with, say:

 curl -f \
    --request POST \
    --header "APIKey: $APIKEY" \
    -F notes="Some notes here" \
    -F image="@$FILENAME" \
    -F mime_type="$MIME_TYPE" \
    "https://yournextmp.popit.mysociety.org/api/v0.1/persons/$PERSON_ID/image"

That new image will be appended to the images array, rather than inserted first. It turns out that mostly we want newly uploaded images to go first in the image array (i.e. become the primary image that the image property is derived from), so it would be good if there were a position=first or position=last option that could be specified to control that.

chrismytton commented 9 years ago

Related to https://github.com/mysociety/popit/issues/62

chrismytton commented 9 years ago

Fixed in https://github.com/mysociety/popit-api/pull/134