aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/services/api/api.service.js22
1 files changed, 2 insertions, 20 deletions
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js
index 120398f0..1f9e9a88 100644
--- a/src/services/api/api.service.js
+++ b/src/services/api/api.service.js
@@ -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 = {