FitTrackee/mpwo_client/src/mwpoApi/index.js

18 lines
440 B
JavaScript
Raw Normal View History

2018-04-29 18:23:46 +02:00
import { apiUrl } from '../utils'
export default class MpwoApi {
static getData(target) {
const request = new Request(`${apiUrl}${target}`, {
method: 'GET',
headers: new Headers({
'Content-Type': 'application/json',
Authorization: `Bearer ${window.localStorage.getItem('authToken')}`,
}),
})
return fetch(request)
.then(response => response.json())
.catch(error => error)
}
}