admin-fe/src/api/peers.js
Maxim Filippov 5ede69326b Revert "Merge branch 'feature/stats' into 'develop'"
This reverts merge request !74
2019-12-21 20:32:38 +00:00

14 lines
406 B
JavaScript

import request from '@/utils/request'
import { getToken } from '@/utils/auth'
import { baseName } from './utils'
export async function fetchPeers(authHost, token) {
return await request({
baseURL: baseName(authHost),
url: `/api/v1/instance/peers`,
method: 'get',
headers: authHeaders(token)
})
}
const authHeaders = (token) => token ? { 'Authorization': `Bearer ${getToken()}` } : {}