pinafore/routes/_api/user.js

13 lines
510 B
JavaScript
Raw Normal View History

import { get, DEFAULT_TIMEOUT } from '../_utils/ajax'
2018-02-24 23:49:28 +01:00
import { auth, basename } from './utils'
2018-01-13 23:19:51 +01:00
2018-02-09 07:29:29 +01:00
export function getVerifyCredentials (instanceName, accessToken) {
let url = `${basename(instanceName)}/api/v1/accounts/verify_credentials`
return get(url, auth(accessToken), {timeout: DEFAULT_TIMEOUT})
2018-01-23 06:16:27 +01:00
}
2018-02-09 07:29:29 +01:00
export function getAccount (instanceName, accessToken, accountId) {
2018-01-23 06:16:27 +01:00
let url = `${basename(instanceName)}/api/v1/accounts/${accountId}`
return get(url, auth(accessToken), {timeout: DEFAULT_TIMEOUT})
2018-01-28 21:51:48 +01:00
}