mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 21:07:27 +00:00
refactor(front): update summoner/overview payload
This commit is contained in:
parent
f00f13b0a4
commit
a6988533e8
2 changed files with 11 additions and 3 deletions
|
|
@ -6,7 +6,7 @@ export const axios = axiosHttp
|
||||||
|
|
||||||
axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'
|
axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'
|
||||||
axios.defaults.headers.common['Content-Type'] = 'application/json'
|
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 CancelToken = axios.CancelToken
|
||||||
const axiosSource = CancelToken.source()
|
const axiosSource = CancelToken.source()
|
||||||
|
|
|
||||||
|
|
@ -179,8 +179,16 @@ export const actions = {
|
||||||
const newMatches = createMatchData(resp.data.matches)
|
const newMatches = createMatchData(resp.data.matches)
|
||||||
commit('MATCHES_FOUND', { newMatches, stats: resp.data.stats })
|
commit('MATCHES_FOUND', { newMatches, stats: resp.data.stats })
|
||||||
},
|
},
|
||||||
async overviewRequest({ commit }) {
|
async overviewRequest({ commit, rootState }) {
|
||||||
const resp = await axios(({ url: 'summoner/overview', data: { account: state.basic.account }, method: 'POST' })).catch(() => { })
|
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('---OVERVIEW---')
|
||||||
console.log(resp.data)
|
console.log(resp.data)
|
||||||
resp.data.matches = createMatchData(resp.data.matchesDetails)
|
resp.data.matches = createMatchData(resp.data.matchesDetails)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue