pinafore/routes/_api/followsAndFollowers.js

15 lines
659 B
JavaScript
Raw Normal View History

import { get, paramsString, DEFAULT_TIMEOUT } from '../_utils/ajax'
2018-04-22 18:06:54 +00:00
import { auth, basename } from './utils'
export async function getFollows (instanceName, accessToken, accountId, limit = 80) {
let url = `${basename(instanceName)}/api/v1/accounts/${accountId}/following`
url += '?' + paramsString({ limit })
return get(url, auth(accessToken), { timeout: DEFAULT_TIMEOUT })
2018-04-22 18:06:54 +00:00
}
export async function getFollowers (instanceName, accessToken, accountId, limit = 80) {
let url = `${basename(instanceName)}/api/v1/accounts/${accountId}/followers`
url += '?' + paramsString({ limit })
return get(url, auth(accessToken), { timeout: DEFAULT_TIMEOUT })
2018-04-22 18:06:54 +00:00
}