Skip to content
Snippets Groups Projects
Commit 7e2e2d3e authored by lain's avatar lain
Browse files

Add media upload to StatusPosterService.

parent f86f0ef7
No related branches found
No related tags found
No related merge requests found
......@@ -12,8 +12,21 @@ const postStatus = ({ store, status, media = [], inReplyToStatusId = undefined }
})
}
const uploadMedia = ({ store, formData }) => {
const credentials = store.state.users.currentUser.credentials
return apiService.uploadMedia({ credentials, formData }).then((xml) => {
return {
id: xml.getElementsByTagName('media_id')[0].textContent,
url: xml.getElementsByTagName('media_url')[0].textContent,
image: xml.getElementsByTagName('atom:link')[0].getAttribute('href')
}
})
}
const statusPosterService = {
postStatus
postStatus,
uploadMedia
}
export default statusPosterService
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment