From 2ce01863273fdefad7bca945f5d58d50a0e8d77b Mon Sep 17 00:00:00 2001 From: taehoon Date: Sat, 4 May 2019 13:11:19 -0400 Subject: [PATCH] update api service functions --- src/services/api/api.service.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index b5858e9d..5f40cfa6 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -213,19 +213,13 @@ const unfollowUser = ({id, credentials}) => { } const pinOwnStatus = ({ id, credentials }) => { - return promisedRequest(MASTODON_PIN_OWN_STATUS(id), { - headers: authHeaders(credentials), - method: 'POST' - }) - .then((data) => parseStatus(data)) + return promisedRequest({ url: MASTODON_PIN_OWN_STATUS(id), credentials, method: 'POST' }) + .then((data) => parseStatus(data)) } const unpinOwnStatus = ({ id, credentials }) => { - return promisedRequest(MASTODON_UNPIN_OWN_STATUS(id), { - headers: authHeaders(credentials), - method: 'POST' - }) - .then((data) => parseStatus(data)) + return promisedRequest({ url: MASTODON_UNPIN_OWN_STATUS(id), credentials, method: 'POST' }) + .then((data) => parseStatus(data)) } const blockUser = ({id, credentials}) => { @@ -508,7 +502,7 @@ const fetchTimeline = ({timeline, credentials, since = false, until = false, use const fetchPinnedStatuses = ({ id, credentials }) => { const url = MASTODON_USER_TIMELINE_URL(id) + '?pinned=true' - return promisedRequest(url, { headers: authHeaders(credentials) }) + return promisedRequest({ url, credentials }) .then((data) => data.map(parseStatus)) }