From 9787d996722e44e6554d936e0995bf4c346207e2 Mon Sep 17 00:00:00 2001 From: taehoon Date: Tue, 30 Apr 2019 16:38:34 -0400 Subject: [PATCH] update api services --- src/services/api/api.service.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index 846fab3a..da44fc54 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -140,14 +140,11 @@ const updateBanner = ({credentials, banner}) => { } const updateProfile = ({credentials, params}) => { - return promisedRequest(MASTODON_PROFILE_UPDATE_URL, { - headers: { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - ...authHeaders(credentials) - }, + return promisedRequest({ + url: MASTODON_PROFILE_UPDATE_URL, method: 'PATCH', - body: JSON.stringify(params) + payload: params, + credentials }) .then((data) => parseUser(data)) } @@ -727,11 +724,11 @@ const markNotificationsAsSeen = ({id, credentials}) => { } const fetchFavoritedByUsers = ({id}) => { - return promisedRequest(MASTODON_STATUS_FAVORITEDBY_URL(id)).then((users) => users.map(parseUser)) + return promisedRequest({ url: MASTODON_STATUS_FAVORITEDBY_URL(id) }).then((users) => users.map(parseUser)) } const fetchRebloggedByUsers = ({id}) => { - return promisedRequest(MASTODON_STATUS_REBLOGGEDBY_URL(id)).then((users) => users.map(parseUser)) + return promisedRequest({ url: MASTODON_STATUS_REBLOGGEDBY_URL(id) }).then((users) => users.map(parseUser)) } const reportUser = ({credentials, userId, statusIds, comment, forward}) => {