remove client-side purchase of Armoire - fixes #9432 (#9463)

This commit is contained in:
Alys 2017-11-16 19:06:45 +10:00 committed by Matteo Pagliazzi
parent 6bdb695616
commit 6b625a60ab

View file

@ -1,5 +1,6 @@
import axios from 'axios';
import buyOp from 'common/script/ops/buy';
import content from 'common/script/content/index';
import purchaseOp from 'common/script/ops/purchaseWithSpell';
import hourglassPurchaseOp from 'common/script/ops/hourglassPurchase';
import sellOp from 'common/script/ops/sell';
@ -38,21 +39,14 @@ export function buyQuestItem (store, params) {
async function buyArmoire (store, params) {
const quantity = params.quantity || 1;
let armoire = content.armoire;
let buyResult = buyOp(store.state.user.data, {
params: {
key: 'armoire',
},
type: 'armoire',
quantity,
});
// We need the server result because armoir has random item in the result
// We need the server result because Armoire has random item in the result
let result = await axios.post('/api/v3/user/buy/armoire', {
type: 'armoire',
quantity,
});
buyResult = result.data.data;
let buyResult = result.data.data;
if (buyResult) {
const resData = buyResult;
@ -65,6 +59,14 @@ async function buyArmoire (store, params) {
}
// @TODO: We might need to abstract notifications to library rather than mixin
store.dispatch('snackbars:add', {
title: '',
text: `- ${armoire.value}`,
type: 'gp',
icon: '',
sign: '-',
timeout: true,
});
store.dispatch('snackbars:add', {
title: '',
text: isExperience ? item.value : item.dropText,