API & Client: add an activity w/o gpx
This commit is contained in:
@ -15,6 +15,20 @@ export default class MpwoApi {
|
||||
.catch(error => error)
|
||||
}
|
||||
|
||||
static addActivityWithoutGpx(data) {
|
||||
const request = new Request(`${apiUrl}activities/no_gpx`, {
|
||||
method: 'POST',
|
||||
headers: new Headers({
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: `Bearer ${window.localStorage.getItem('authToken')}`,
|
||||
}),
|
||||
body: JSON.stringify(data)
|
||||
})
|
||||
return fetch(request)
|
||||
.then(response => response.json())
|
||||
.catch(error => error)
|
||||
}
|
||||
|
||||
static getActivityGpx(activityId) {
|
||||
const request = new Request(`${apiUrl}activities/${activityId}/gpx`, {
|
||||
method: 'GET',
|
||||
|
Reference in New Issue
Block a user