{"action":"closed","number":134,"pull_request":{"url":"https://api.github.com/repos/mysociety/popit-api/pulls/134","id":31737924,"html_url":"https://github.com/mysociety/popit-api/pull/134","diff_url":"https://github.com/mysociety/popit-api/pull/134.diff","patch_url":"https://github.com/mysociety/popit-api/pull/134.patch","issue_url":"https://api.github.com/repos/mysociety/popit-api/issues/134","number":134,"state":"closed","locked":false,"title":"Allow one to determine the position of an uploaded image in 'images'","user":{"login":"mhl","id":7907,"avatar_url":"https://avatars.githubusercontent.com/u/7907?v=3","gravatar_id":"","url":"https://api.github.com/users/mhl","html_url":"https://github.com/mhl","followers_url":"https://api.github.com/users/mhl/followers","following_url":"https://api.github.com/users/mhl/following{/other_user}","gists_url":"https://api.github.com/users/mhl/gists{/gist_id}","starred_url":"https://api.github.com/users/mhl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhl/subscriptions","organizations_url":"https://api.github.com/users/mhl/orgs","repos_url":"https://api.github.com/users/mhl/repos","events_url":"https://api.github.com/users/mhl/events{/privacy}","received_events_url":"https://api.github.com/users/mhl/received_events","type":"User","site_admin":false},"body":"The behaviour when you upload an image via the PopIt API at the moment\r\nis that it is appended to the 'images' array.  It would be helpful to be\r\nable to instead say that the image should be inserted at the front of\r\nthe 'images' array, so that it's the \"primary\" image for that person\r\n(i.e. the one that is used for the 'image' property)\r\n\r\nThis commit introduces a special parameter called 'index' when POSTing a\r\nnew image, which can be either set to 'first', 'last', '0', '1', '2',\r\n'3', etc. to insert the image at the start of 'images', the end of\r\n'images' or at a specific index (where 0 is the first place in the\r\narray).","created_at":"2015-03-23T14:41:53Z","updated_at":"2015-03-24T14:16:48Z","closed_at":"2015-03-24T14:16:48Z","merged_at":"2015-03-24T14:16:48Z","merge_commit_sha":"9fc198bfff489e559dc9143dbbc0c9288e6f0154","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mysociety/popit-api/pulls/134/commits","review_comments_url":"https://api.github.com/repos/mysociety/popit-api/pulls/134/comments","review_comment_url":"https://api.github.com/repos/mysociety/popit-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mysociety/popit-api/issues/134/comments","statuses_url":"https://api.github.com/repos/mysociety/popit-api/statuses/fa660c5c5bdb50b888d6adb5b8d818621f3be4e9","head":{"label":"mysociety:add-images-index","ref":"add-images-index","sha":"fa660c5c5bdb50b888d6adb5b8d818621f3be4e9","user":{"login":"mysociety","id":141338,"avatar_url":"https://avatars.githubusercontent.com/u/141338?v=3","gravatar_id":"","url":"https://api.github.com/users/mysociety","html_url":"https://github.com/mysociety","followers_url":"https://api.github.com/users/mysociety/followers","following_url":"https://api.github.com/users/mysociety/following{/other_user}","gists_url":"https://api.github.com/users/mysociety/gists{/gist_id}","starred_url":"https://api.github.com/users/mysociety/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mysociety/subscriptions","organizations_url":"https://api.github.com/users/mysociety/orgs","repos_url":"https://api.github.com/users/mysociety/repos","events_url":"https://api.github.com/users/mysociety/events{/privacy}","received_events_url":"https://api.github.com/users/mysociety/received_events","type":"Organization","site_admin":false},"repo":{"id":8774507,"name":"popit-api","full_name":"mysociety/popit-api","owner":{"login":"mysociety","id":141338,"avatar_url":"https://avatars.githubusercontent.com/u/141338?v=3","gravatar_id":"","url":"https://api.github.com/users/mysociety","html_url":"https://github.com/mysociety","followers_url":"https://api.github.com/users/mysociety/followers","following_url":"https://api.github.com/users/mysociety/following{/other_user}","gists_url":"https://api.github.com/users/mysociety/gists{/gist_id}","starred_url":"https://api.github.com/users/mysociety/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mysociety/subscriptions","organizations_url":"https://api.github.com/users/mysociety/orgs","repos_url":"https://api.github.com/users/mysociety/repos","events_url":"https://api.github.com/users/mysociety/events{/privacy}","received_events_url":"https://api.github.com/users/mysociety/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mysociety/popit-api","description":"PopIt API code - can be used as a standalone PopIt/Popolo API server or embedded in an Express website","fork":false,"url":"https://api.github.com/repos/mysociety/popit-api","forks_url":"https://api.github.com/repos/mysociety/popit-api/forks","keys_url":"https://api.github.com/repos/mysociety/popit-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mysociety/popit-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mysociety/popit-api/teams","hooks_url":"https://api.github.com/repos/mysociety/popit-api/hooks","issue_events_url":"https://api.github.com/repos/mysociety/popit-api/issues/events{/number}","events_url":"https://api.github.com/repos/mysociety/popit-api/events","assignees_url":"https://api.github.com/repos/mysociety/popit-api/assignees{/user}","branches_url":"https://api.github.com/repos/mysociety/popit-api/branches{/branch}","tags_url":"https://api.github.com/repos/mysociety/popit-api/tags","blobs_url":"https://api.github.com/repos/mysociety/popit-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mysociety/popit-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mysociety/popit-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/mysociety/popit-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mysociety/popit-api/statuses/{sha}","languages_url":"https://api.github.com/repos/mysociety/popit-api/languages","stargazers_url":"https://api.github.com/repos/mysociety/popit-api/stargazers","contributors_url":"https://api.github.com/repos/mysociety/popit-api/contributors","subscribers_url":"https://api.github.com/repos/mysociety/popit-api/subscribers","subscription_url":"https://api.github.com/repos/mysociety/popit-api/subscription","commits_url":"https://api.github.com/repos/mysociety/popit-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/mysociety/popit-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/mysociety/popit-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/mysociety/popit-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/mysociety/popit-api/contents/{+path}","compare_url":"https://api.github.com/repos/mysociety/popit-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mysociety/popit-api/merges","archive_url":"https://api.github.com/repos/mysociety/popit-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mysociety/popit-api/downloads","issues_url":"https://api.github.com/repos/mysociety/popit-api/issues{/number}","pulls_url":"https://api.github.com/repos/mysociety/popit-api/pulls{/number}","milestones_url":"https://api.github.com/repos/mysociety/popit-api/milestones{/number}","notifications_url":"https://api.github.com/repos/mysociety/popit-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mysociety/popit-api/labels{/name}","releases_url":"https://api.github.com/repos/mysociety/popit-api/releases{/id}","created_at":"2013-03-14T12:15:34Z","updated_at":"2015-03-24T14:16:48Z","pushed_at":"2015-03-24T14:16:48Z","git_url":"git://github.com/mysociety/popit-api.git","ssh_url":"git@github.com:mysociety/popit-api.git","clone_url":"https://github.com/mysociety/popit-api.git","svn_url":"https://github.com/mysociety/popit-api","homepage":null,"size":2781,"stargazers_count":14,"watchers_count":14,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":32,"forks":2,"open_issues":32,"watchers":14,"default_branch":"master"}},"base":{"label":"mysociety:master","ref":"master","sha":"26fa40b50deee67a1ce8711ef5f35a7cd977c18d","user":{"login":"mysociety","id":141338,"avatar_url":"https://avatars.githubusercontent.com/u/141338?v=3","gravatar_id":"","url":"https://api.github.com/users/mysociety","html_url":"https://github.com/mysociety","followers_url":"https://api.github.com/users/mysociety/followers","following_url":"https://api.github.com/users/mysociety/following{/other_user}","gists_url":"https://api.github.com/users/mysociety/gists{/gist_id}","starred_url":"https://api.github.com/users/mysociety/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mysociety/subscriptions","organizations_url":"https://api.github.com/users/mysociety/orgs","repos_url":"https://api.github.com/users/mysociety/repos","events_url":"https://api.github.com/users/mysociety/events{/privacy}","received_events_url":"https://api.github.com/users/mysociety/received_events","type":"Organization","site_admin":false},"repo":{"id":8774507,"name":"popit-api","full_name":"mysociety/popit-api","owner":{"login":"mysociety","id":141338,"avatar_url":"https://avatars.githubusercontent.com/u/141338?v=3","gravatar_id":"","url":"https://api.github.com/users/mysociety","html_url":"https://github.com/mysociety","followers_url":"https://api.github.com/users/mysociety/followers","following_url":"https://api.github.com/users/mysociety/following{/other_user}","gists_url":"https://api.github.com/users/mysociety/gists{/gist_id}","starred_url":"https://api.github.com/users/mysociety/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mysociety/subscriptions","organizations_url":"https://api.github.com/users/mysociety/orgs","repos_url":"https://api.github.com/users/mysociety/repos","events_url":"https://api.github.com/users/mysociety/events{/privacy}","received_events_url":"https://api.github.com/users/mysociety/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mysociety/popit-api","description":"PopIt API code - can be used as a standalone PopIt/Popolo API server or embedded in an Express website","fork":false,"url":"https://api.github.com/repos/mysociety/popit-api","forks_url":"https://api.github.com/repos/mysociety/popit-api/forks","keys_url":"https://api.github.com/repos/mysociety/popit-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mysociety/popit-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mysociety/popit-api/teams","hooks_url":"https://api.github.com/repos/mysociety/popit-api/hooks","issue_events_url":"https://api.github.com/repos/mysociety/popit-api/issues/events{/number}","events_url":"https://api.github.com/repos/mysociety/popit-api/events","assignees_url":"https://api.github.com/repos/mysociety/popit-api/assignees{/user}","branches_url":"https://api.github.com/repos/mysociety/popit-api/branches{/branch}","tags_url":"https://api.github.com/repos/mysociety/popit-api/tags","blobs_url":"https://api.github.com/repos/mysociety/popit-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mysociety/popit-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mysociety/popit-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/mysociety/popit-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mysociety/popit-api/statuses/{sha}","languages_url":"https://api.github.com/repos/mysociety/popit-api/languages","stargazers_url":"https://api.github.com/repos/mysociety/popit-api/stargazers","contributors_url":"https://api.github.com/repos/mysociety/popit-api/contributors","subscribers_url":"https://api.github.com/repos/mysociety/popit-api/subscribers","subscription_url":"https://api.github.com/repos/mysociety/popit-api/subscription","commits_url":"https://api.github.com/repos/mysociety/popit-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/mysociety/popit-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/mysociety/popit-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/mysociety/popit-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/mysociety/popit-api/contents/{+path}","compare_url":"https://api.github.com/repos/mysociety/popit-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mysociety/popit-api/merges","archive_url":"https://api.github.com/repos/mysociety/popit-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mysociety/popit-api/downloads","issues_url":"https://api.github.com/repos/mysociety/popit-api/issues{/number}","pulls_url":"https://api.github.com/repos/mysociety/popit-api/pulls{/number}","milestones_url":"https://api.github.com/repos/mysociety/popit-api/milestones{/number}","notifications_url":"https://api.github.com/repos/mysociety/popit-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mysociety/popit-api/labels{/name}","releases_url":"https://api.github.com/repos/mysociety/popit-api/releases{/id}","created_at":"2013-03-14T12:15:34Z","updated_at":"2015-03-24T14:16:48Z","pushed_at":"2015-03-24T14:16:48Z","git_url":"git://github.com/mysociety/popit-api.git","ssh_url":"git@github.com:mysociety/popit-api.git","clone_url":"https://github.com/mysociety/popit-api.git","svn_url":"https://github.com/mysociety/popit-api","homepage":null,"size":2781,"stargazers_count":14,"watchers_count":14,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":32,"forks":2,"open_issues":32,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mysociety/popit-api/pulls/134"},"html":{"href":"https://github.com/mysociety/popit-api/pull/134"},"issue":{"href":"https://api.github.com/repos/mysociety/popit-api/issues/134"},"comments":{"href":"https://api.github.com/repos/mysociety/popit-api/issues/134/comments"},"review_comments":{"href":"https://api.github.com/repos/mysociety/popit-api/pulls/134/comments"},"review_comment":{"href":"https://api.github.com/repos/mysociety/popit-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mysociety/popit-api/pulls/134/commits"},"statuses":{"href":"https://api.github.com/repos/mysociety/popit-api/statuses/fa660c5c5bdb50b888d6adb5b8d818621f3be4e9"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"chrismytton","id":22996,"avatar_url":"https://avatars.githubusercontent.com/u/22996?v=3","gravatar_id":"","url":"https://api.github.com/users/chrismytton","html_url":"https://github.com/chrismytton","followers_url":"https://api.github.com/users/chrismytton/followers","following_url":"https://api.github.com/users/chrismytton/following{/other_user}","gists_url":"https://api.github.com/users/chrismytton/gists{/gist_id}","starred_url":"https://api.github.com/users/chrismytton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrismytton/subscriptions","organizations_url":"https://api.github.com/users/chrismytton/orgs","repos_url":"https://api.github.com/users/chrismytton/repos","events_url":"https://api.github.com/users/chrismytton/events{/privacy}","received_events_url":"https://api.github.com/users/chrismytton/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"commits":1,"additions":10,"deletions":1,"changed_files":1}}