1
0
mirror of https://github.com/nolanlawson/pinafore synced 2024-12-12 02:07:26 +01:00
Pinafore-Web-Client-Frontend/routes/_actions/followRequests.js
2018-03-14 22:32:58 -07:00

18 lines
722 B
JavaScript

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))
}