refactor error handling of pinStatus

This commit is contained in:
taehoon 2019-04-24 16:19:27 -04:00
parent ce1d19136d
commit 1229622fed
3 changed files with 8 additions and 17 deletions

View file

@ -213,19 +213,17 @@ const unfollowUser = ({id, credentials}) => {
}
const pinOwnStatus = ({ id, credentials }) => {
let url = MASTODON_PIN_OWN_STATUS(id)
return fetch(url, {
return promisedRequest(MASTODON_PIN_OWN_STATUS(id), {
headers: authHeaders(credentials),
method: 'POST'
}).then((data) => data.json())
})
}
const unpinOwnStatus = ({ id, credentials }) => {
let url = MASTODON_UNPIN_OWN_STATUS(id)
return fetch(url, {
return promisedRequest(MASTODON_UNPIN_OWN_STATUS(id), {
headers: authHeaders(credentials),
method: 'POST'
}).then((data) => data.json())
})
}
const blockUser = ({id, credentials}) => {