updated user_card

This commit is contained in:
Maksim Pechnikov 2019-10-08 10:21:48 +03:00
parent 9c305c5f93
commit a26d550137
7 changed files with 240 additions and 150 deletions

View file

@ -219,13 +219,16 @@ const authHeaders = (accessToken) => {
}
}
const followUser = ({ id, reblogs, credentials }) => {
const followUser = ({ id, credentials, ...options }) => {
let url = MASTODON_FOLLOW_URL(id)
const form = new FormData()
if (reblogs !== undefined) { form.append('reblogs', reblogs) }
const form = {}
if (options.reblogs !== undefined) { form['reblogs'] = options.reblogs }
return fetch(url, {
body: form,
headers: authHeaders(credentials),
body: JSON.stringify(form),
headers: {
...authHeaders(credentials),
'Content-Type': 'application/json'
},
method: 'POST'
}).then((data) => data.json())
}