clean up fetchPinnedStatuses api service

This commit is contained in:
taehoon 2019-04-24 21:52:50 -04:00
parent 8308315038
commit 93e9bc019e
1 changed files with 1 additions and 8 deletions

View File

@ -506,14 +506,7 @@ const fetchTimeline = ({timeline, credentials, since = false, until = false, use
const fetchPinnedStatuses = ({ id, credentials }) => {
const url = MASTODON_USER_TIMELINE_URL(id) + '?pinned=true'
return fetch(url, { headers: authHeaders(credentials) })
.then((data) => {
if (data.ok) {
return data
}
throw new Error('Error fetching pinned timeline', data)
})
.then((data) => data.json())
return promisedRequest(url, { headers: authHeaders(credentials) })
.then((data) => data.map(parseStatus))
}