2017-07-25 14:24:40 +00:00
|
|
|
import axios from 'axios';
|
|
|
|
|
|
|
|
|
|
export async function getHeroes () {
|
|
|
|
|
let url = '/api/v3/hall/heroes';
|
|
|
|
|
let response = await axios.get(url);
|
|
|
|
|
return response.data.data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function getHero (store, payload) {
|
|
|
|
|
let url = `/api/v3/hall/heroes/${payload.uuid}`;
|
|
|
|
|
let response = await axios.get(url);
|
|
|
|
|
return response.data.data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function updateHero (store, payload) {
|
|
|
|
|
let url = `/api/v3/hall/heroes/${payload.heroDetails._id}`;
|
2017-09-07 19:26:53 +00:00
|
|
|
let response = await axios.put(url, payload.heroDetails);
|
2017-07-25 14:24:40 +00:00
|
|
|
return response.data.data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function getPatrons (store, payload) {
|
|
|
|
|
let page = 0;
|
|
|
|
|
if (payload.page) page = payload.page;
|
|
|
|
|
|
|
|
|
|
let url = `/api/v3/hall/patrons/?page=${page}`;
|
|
|
|
|
let response = await axios.get(url);
|
|
|
|
|
return response.data.data;
|
|
|
|
|
}
|