From 3f58676849ef28b03c9ef05ac0537010e6d7b8f9 Mon Sep 17 00:00:00 2001 From: Tiago vasconcelos Date: Wed, 27 Jul 2022 16:46:27 +0100 Subject: [PATCH] rename shop to market and create market --- .../templates/diagonalley/index.html | 52 +++++++++---------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/lnbits/extensions/diagonalley/templates/diagonalley/index.html b/lnbits/extensions/diagonalley/templates/diagonalley/index.html index dbe443eb..893830a9 100644 --- a/lnbits/extensions/diagonalley/templates/diagonalley/index.html +++ b/lnbits/extensions/diagonalley/templates/diagonalley/index.html @@ -170,13 +170,13 @@ - +
Launch - Cancel
@@ -924,7 +924,7 @@ new Vue({ show: false, data: {countries:[]} }, - shopDialog: { + marketDialog: { show: false, data: {activate: false} }, @@ -1410,16 +1410,14 @@ new Vue({ this.shopDialog.show = true }, sendShopFormData: function () { - if (this.shopDialog.data.id) { - } else { - var data = { - countries: this.shopDialog.data.countries, - cost: this.shopDialog.data.cost - } - } + let data = {...this.marketDialog.data} - if (this.shopDialog.data.id) { - this.updateZone(this.shopDialog.data) + if(!data.usr) { + data.usr = this.g.user.id + } + + if (data.id) { + this.updateZone(data) } else { this.createZone(data) } @@ -1448,24 +1446,22 @@ new Vue({ LNbits.utils.notifyApiError(error) }) }, - createShop: function (data) { - console.log('cuntywoo') + createShop(data) { + console.log('data') LNbits.api .request( 'POST', - '/diagonalley/api/v1/shops', - _.findWhere(self.g.user.wallets, { - id: self.shopDialog.data.wallet - }).inkey, + '/diagonalley/api/v1/markets', + this.g.user.wallets[0].inkey, data ) - .then(function (response) { - self.shops.push(mapShops(response.data)) - self.shopDialog.show = false - self.shopDialog.data = {} + .then((response) => { + this.shops.push(mapShops(response.data)) + this.shopDialog.show = false + this.shopDialog.data = {} data = {} }) - .catch(function (error) { + .catch((error) => { LNbits.utils.notifyApiError(error) }) },