mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 12:57:28 +00:00
Fix the region changes with the new Jax wrapper
This commit is contained in:
parent
56f78fc8a2
commit
0aba0954e4
4 changed files with 9 additions and 2 deletions
|
|
@ -29,6 +29,7 @@ export const mutations = {
|
|||
export const actions = {
|
||||
async summonerRequest({ commit, dispatch, rootState }, { summoner, region }) {
|
||||
console.log(summoner, region)
|
||||
region = rootState.regionsList[region]
|
||||
commit('SUMMONER_REQUEST')
|
||||
try {
|
||||
const resp = await axios(({ url: 'api', data: { summoner, region }, method: 'POST' }))
|
||||
|
|
|
|||
|
|
@ -76,7 +76,6 @@ export default {
|
|||
return this.$route.params.region
|
||||
},
|
||||
...mapState({
|
||||
regionsList: state => state.regionsList,
|
||||
localInfos: state => state.summoner.infos,
|
||||
summonerFound: state => state.summoner.summonerFound,
|
||||
loading: state => state.summoner.loading
|
||||
|
|
|
|||
|
|
@ -39,6 +39,13 @@ class Jax {
|
|||
|
||||
set regionName(regionName) {
|
||||
this.region = regionName
|
||||
const blacklistedProperties = ['key', 'limiter', 'region', 'version', 'DDragon']
|
||||
|
||||
for (const key of Object.getOwnPropertyNames(this)) {
|
||||
if(blacklistedProperties.includes(key)) continue
|
||||
|
||||
this[key].region = regionName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ const app = express()
|
|||
import { Jax } from "./Jax"
|
||||
|
||||
/* Set Port */
|
||||
app.set('port', (process.env.PORT || 5000))
|
||||
app.set('port', (process.env.PORT || 3333))
|
||||
|
||||
/* Setup Cors */
|
||||
app.use(cors({
|
||||
|
|
|
|||
Loading…
Reference in a new issue