1
0
mirror of https://github.com/nolanlawson/pinafore synced 2025-01-09 17:54:20 +01:00
Pinafore-Web-Client-Frontend/routes/_api/relationships.js
2018-08-25 22:03:33 -07:00

9 lines
384 B
JavaScript

import { basename, auth } from './utils'
import { get, paramsString, DEFAULT_TIMEOUT } from '../_utils/ajax'
export async function getRelationship (instanceName, accessToken, accountId) {
let url = `${basename(instanceName)}/api/v1/accounts/relationships?${paramsString({id: accountId})}`
let res = await get(url, auth(accessToken), {timeout: DEFAULT_TIMEOUT})
return res[0]
}