pinafore/routes/_api/requests.js

13 lines
580 B
JavaScript
Raw Normal View History

import { post, WRITE_TIMEOUT } from '../_utils/ajax'
import { auth, basename } from './utils'
export async function approveFollowRequest (instanceName, accessToken, accountId) {
let url = `${basename(instanceName)}/api/v1/follow_requests/${accountId}/authorize`
return post(url, null, auth(accessToken), { timeout: WRITE_TIMEOUT })
}
export async function rejectFollowRequest (instanceName, accessToken, accountId) {
let url = `${basename(instanceName)}/api/v1/follow_requests/${accountId}/reject`
return post(url, null, auth(accessToken), { timeout: WRITE_TIMEOUT })
}