Commit 9bfc868e authored by Gijs Hendriksen's avatar Gijs Hendriksen
Browse files

Changed urls to use the new API versioning system

parent 7907f098
import * as types from './actionTypes';
import { url } from '../url';
import { apiUrl } from '../url';
export function calendarRetrieved(eventList) {
return {
......@@ -24,7 +24,7 @@ export function retrieveCalendar(token) {
Authorization: `Token ${token}`,
},
};
return fetch(`${url}/api/events/`, data)
return fetch(`${apiUrl}/events/`, data)
.then(
response => response.json())
.then(
......
import * as types from './actionTypes';
import { navigate } from './navigation';
import { url } from '../url';
import { apiUrl } from '../url';
export function success(data, registrations) {
return {
......@@ -25,7 +25,7 @@ function loadRegistrations(id, token) {
Authorization: `Token ${token}`,
},
};
return fetch(`${url}/api/events/${id}/registrations/?status=registered`, data)
return fetch(`${apiUrl}/events/${id}/registrations/?status=registered`, data)
.then(
response => response.json(),
)
......@@ -45,7 +45,7 @@ export function loadEvent(id, token) {
Authorization: `Token ${token}`,
},
};
return fetch(`${url}/api/events/${id}/`, data)
return fetch(`${apiUrl}/events/${id}/`, data)
.then(
response => response.json(),
)
......
import { AsyncStorage } from 'react-native';
import * as types from './actionTypes';
import { url } from '../url';
import { url, apiUrl } from '../url';
const USERNAMEKEY = '@MyStore:username';
const TOKENKEY = '@MyStore:token';
......@@ -56,7 +56,7 @@ function getUserInfo(token) {
},
};
return fetch(`${url}/api/members/me/`, data)
return fetch(`${apiUrl}/members/me/`, data)
.then(
response => response.json())
.then(
......@@ -90,7 +90,7 @@ export function login(user, pass) {
password: pass,
}),
};
return fetch(`${url}/api/token-auth/`, data)
return fetch(`${apiUrl}/token-auth/`, data)
.then(
response => response.json())
.then(
......
......@@ -4,3 +4,4 @@ if (__DEV__) { // eslint-disable-line no-undef
}
export const url = server;
export const apiUrl = `${server}/api/v1`;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment