adds a working inventory
This commit is contained in:
@@ -21,6 +21,10 @@ export const Api = {
|
||||
return fetch(API_ENDPOINT("players/all"))
|
||||
.then(r => r.json())
|
||||
},
|
||||
fetchInventory () {
|
||||
return fetch(API_ENDPOINT("items"))
|
||||
.then(r => r.json())
|
||||
},
|
||||
fetchClaims () {
|
||||
return fetch(API_ENDPOINT("claims"))
|
||||
.then(r => r.json())
|
||||
@@ -51,6 +55,7 @@ export const AppStorage = {
|
||||
player_list: {},
|
||||
group_loot: [],
|
||||
player_claims: {},
|
||||
inventory: [],
|
||||
initiated: false,
|
||||
show_player_chest: false,
|
||||
},
|
||||
@@ -63,13 +68,15 @@ export const AppStorage = {
|
||||
.all([
|
||||
Api.fetchPlayerList(),
|
||||
Api.fetchClaims(),
|
||||
Api.fetchInventory(),
|
||||
Api.fetchLoot(0)
|
||||
])
|
||||
.then(data => {
|
||||
const [players, claims, group_loot] = data;
|
||||
const [players, claims, inventory, group_loot] = data;
|
||||
this.__initPlayerList(players);
|
||||
this.__initClaimsStore(claims);
|
||||
Vue.set(this.state, 'group_loot', group_loot);
|
||||
Vue.set(this.state, 'inventory', inventory);
|
||||
})
|
||||
.then(_ => this.state.initiated = true)
|
||||
.catch(e => { alert(e); this.state.initiated = false });
|
||||
|
||||
Reference in New Issue
Block a user