diff --git a/lootalot_front/src/AppStorage.js b/lootalot_front/src/AppStorage.js index 2e80e5e..a2f0b0f 100644 --- a/lootalot_front/src/AppStorage.js +++ b/lootalot_front/src/AppStorage.js @@ -34,23 +34,23 @@ export const Api = { .then(r => r.json()) }, putClaim (player_id, item_id) { - const payload = { player_id, item_id }; + const payload = item_id; return this.__doFetch("players/" + player_id + "/claims", 'PUT', payload); }, unClaim (player_id, item_id) { - const payload = { player_id, item_id }; + const payload = item_id; return this.__doFetch("players/" + player_id + "/claims", 'DELETE', payload); }, updateWealth (player_id, value_in_gp) { - const payload = { player_id, value_in_gp: Number(value_in_gp) }; + const payload = Number(value_in_gp); return this.__doFetch("players/" + player_id + "/wealth", 'PUT', payload); }, buyItems (player_id, items) { - const payload = { player_id, items }; + const payload = items; return this.__doFetch("players/" + player_id + "/loot", 'PUT', payload); }, sellItems (player_id, items) { - const payload = { player_id, items }; + const payload = items; return this.__doFetch("players/" + player_id + "/loot", 'DELETE', payload); }, newLoot (items) { @@ -84,10 +84,10 @@ export const AppStorage = { ]) .then(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); + this.__initPlayerList(players.value); + this.__initClaimsStore(claims.value); + Vue.set(this.state, 'group_loot', group_loot.value); + Vue.set(this.state, 'inventory', inventory.value); }) .then(_ => this.state.initiated = true) .catch(e => { alert(e); this.state.initiated = false });