2018-06-13 14:38:36 +00:00
|
|
|
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 })
|
2018-08-30 04:42:57 +00:00
|
|
|
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 })
|
2018-08-30 04:42:57 +00:00
|
|
|
return get(url, auth(accessToken), { timeout: DEFAULT_TIMEOUT })
|
2018-04-22 18:06:54 +00:00
|
|
|
}
|