1
0
mirror of https://github.com/nolanlawson/pinafore synced 2025-02-03 15:17:37 +01:00

18 lines
722 B
JavaScript
Raw Normal View History

2018-03-14 22:14:06 -07:00
import { getWithTimeout, postWithTimeout } from '../_utils/ajax'
import { auth, basename } from '../_api/utils'
export async function getFollowRequests (instanceName, accessToken) {
let url = `${basename(instanceName)}/api/v1/follow_requests`
return getWithTimeout(url, auth(accessToken))
}
export async function authorizeFollowRequest (instanceName, accessToken, id) {
let url = `${basename(instanceName)}/api/v1/follow_requests/${id}/authorize`
return postWithTimeout(url, null, auth(accessToken))
}
export async function rejectFollowRequest (instanceName, accessToken, id) {
let url = `${basename(instanceName)}/api/v1/follow_requests/${id}/reject`
return postWithTimeout(url, null, auth(accessToken))
}