2018-06-13 16:38:36 +02:00
|
|
|
import { get, paramsString, DEFAULT_TIMEOUT } from '../_utils/ajax'
|
2018-04-22 20:06:54 +02: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 06:42:57 +02:00
|
|
|
return get(url, auth(accessToken), { timeout: DEFAULT_TIMEOUT })
|
2018-04-22 20:06:54 +02: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 06:42:57 +02:00
|
|
|
return get(url, auth(accessToken), { timeout: DEFAULT_TIMEOUT })
|
2018-04-22 20:06:54 +02:00
|
|
|
}
|