adds buy/sell endpoints
This commit is contained in:
@@ -89,8 +89,12 @@
|
||||
methods: {
|
||||
buySelectedItems () {
|
||||
const items = this.items.filter(i => this.selected_items.includes(i.id));
|
||||
this.$emit("buy", items);
|
||||
this.selected_items.length = 0;
|
||||
var payload = [];
|
||||
items.forEach(item => {
|
||||
payload.push([item.id, null]);
|
||||
});
|
||||
this.$emit("buy", payload);
|
||||
this.selected_items = [];
|
||||
},
|
||||
sellSelectedItems () {
|
||||
if (!this.is_selling) {
|
||||
@@ -99,7 +103,11 @@
|
||||
this.is_selling = false;
|
||||
if (this.selected_items.length > 0) {
|
||||
const items = this.items.filter(i => this.selected_items.includes(i.id));
|
||||
this.$emit("sell", items);
|
||||
var payload = [];
|
||||
items.forEach(item => {
|
||||
payload.push([item.id, null]);
|
||||
});
|
||||
this.$emit("sell", payload);
|
||||
this.selected_items = [];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user