refactor(front): update summoner/overview payload

This commit is contained in:
Valentin Kaelin 2020-10-10 22:06:12 +02:00
parent f00f13b0a4
commit a6988533e8
2 changed files with 11 additions and 3 deletions

View file

@ -6,7 +6,7 @@ export const axios = axiosHttp
axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'
axios.defaults.headers.common['Content-Type'] = 'application/json'
axios.defaults.baseURL = process.env.NODE_ENV === 'development' ? 'http://localhost:5000/' : 'https://api.leaguestats.gg/'
axios.defaults.baseURL = process.env.NODE_ENV === 'development' ? 'http://localhost:3333/' : 'https://api.leaguestats.gg/'
const CancelToken = axios.CancelToken
const axiosSource = CancelToken.source()

View file

@ -179,8 +179,16 @@ export const actions = {
const newMatches = createMatchData(resp.data.matches)
commit('MATCHES_FOUND', { newMatches, stats: resp.data.stats })
},
async overviewRequest({ commit }) {
const resp = await axios(({ url: 'summoner/overview', data: { account: state.basic.account }, method: 'POST' })).catch(() => { })
async overviewRequest({ commit, rootState }) {
const resp = await axios(({
url: 'summoner/overview',
data: {
puuid: state.basic.account.puuid,
accountId: state.basic.account.accountId,
region: rootState.regionsList[rootState.settings.region],
},
method: 'POST'
})).catch(() => { })
console.log('---OVERVIEW---')
console.log(resp.data)
resp.data.matches = createMatchData(resp.data.matchesDetails)