From 93e9bc019ec153f01910a3e0391d96ea776cf2ff Mon Sep 17 00:00:00 2001 From: taehoon Date: Wed, 24 Apr 2019 21:52:50 -0400 Subject: [PATCH] clean up fetchPinnedStatuses api service --- src/services/api/api.service.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index 86fb6365..426d40e4 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -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)) }