forked from AkkomaGang/akkoma-fe
add promisedRequest helper
This commit is contained in:
parent
cea6ea42f0
commit
02d169b92c
1 changed files with 10 additions and 14 deletions
|
@ -724,21 +724,17 @@ const fetchRebloggedByUsers = ({id}) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const reportUser = ({credentials, userId, statusIds, comment, forward}) => {
|
const reportUser = ({credentials, userId, statusIds, comment, forward}) => {
|
||||||
const payload = {
|
return promisedRequest({
|
||||||
'account_id': userId,
|
uri: MASTODON_REPORT_USER_URL,
|
||||||
'status_ids': statusIds,
|
method: 'POST',
|
||||||
comment,
|
payload: {
|
||||||
forward
|
'account_id': userId,
|
||||||
}
|
'status_ids': statusIds,
|
||||||
return fetch(MASTODON_REPORT_USER_URL, {
|
comment,
|
||||||
body: JSON.stringify(payload),
|
forward
|
||||||
headers: {
|
|
||||||
...authHeaders(credentials),
|
|
||||||
'Accept': 'application/json',
|
|
||||||
'Content-Type': 'application/json'
|
|
||||||
},
|
},
|
||||||
method: 'POST'
|
credentials
|
||||||
}).then((data) => data.json())
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const apiService = {
|
const apiService = {
|
||||||
|
|
Loading…
Reference in a new issue