use promisedRequest for api call
This commit is contained in:
parent
4ab2ddb03c
commit
0c3a922341
1 changed files with 2 additions and 20 deletions
|
@ -725,29 +725,11 @@ const markNotificationsAsSeen = ({id, credentials}) => {
|
|||
}
|
||||
|
||||
const fetchFavouritedByUsers = ({id}) => {
|
||||
return fetch(MASTODON_STATUS_FAVOURITEDBY_URL(id), {
|
||||
method: 'GET'
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json()
|
||||
} else {
|
||||
throw new Error('Error fetching favorited by users')
|
||||
}
|
||||
})
|
||||
return promisedRequest(MASTODON_STATUS_FAVOURITEDBY_URL(id)).then((users) => users.map(parseUser))
|
||||
}
|
||||
|
||||
const fetchRebloggedByUsers = ({id}) => {
|
||||
return fetch(MASTODON_STATUS_REBLOGGEDBY_URL(id), {
|
||||
method: 'GET'
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json()
|
||||
} else {
|
||||
throw new Error('Error reblogged by users')
|
||||
}
|
||||
})
|
||||
return promisedRequest(MASTODON_STATUS_REBLOGGEDBY_URL(id)).then((users) => users.map(parseUser))
|
||||
}
|
||||
|
||||
const apiService = {
|
||||
|
|
Loading…
Reference in a new issue