update api services

This commit is contained in:
taehoon 2019-04-30 16:38:34 -04:00
parent 220a7e89d5
commit 9787d99672

View file

@ -140,14 +140,11 @@ const updateBanner = ({credentials, banner}) => {
} }
const updateProfile = ({credentials, params}) => { const updateProfile = ({credentials, params}) => {
return promisedRequest(MASTODON_PROFILE_UPDATE_URL, { return promisedRequest({
headers: { url: MASTODON_PROFILE_UPDATE_URL,
'Accept': 'application/json',
'Content-Type': 'application/json',
...authHeaders(credentials)
},
method: 'PATCH', method: 'PATCH',
body: JSON.stringify(params) payload: params,
credentials
}) })
.then((data) => parseUser(data)) .then((data) => parseUser(data))
} }
@ -727,11 +724,11 @@ const markNotificationsAsSeen = ({id, credentials}) => {
} }
const fetchFavoritedByUsers = ({id}) => { 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}) => { 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}) => { const reportUser = ({credentials, userId, statusIds, comment, forward}) => {