From 8bc63084f5dc9e1925212aa1102951e2565ae7a5 Mon Sep 17 00:00:00 2001 From: Engels Baca Sevilla Date: Wed, 18 Aug 2021 14:42:35 -0600 Subject: [PATCH 1/2] Trello#138 Adding lightning accepted field --- nuxt/components/AddStoreModal.vue | 18 ++++++++++++++---- nuxt/store/actions.js | 17 +++++------------ 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/nuxt/components/AddStoreModal.vue b/nuxt/components/AddStoreModal.vue index 99d071d2..da54cd6c 100644 --- a/nuxt/components/AddStoreModal.vue +++ b/nuxt/components/AddStoreModal.vue @@ -125,6 +125,14 @@ +
+ +
+ { diff --git a/nuxt/store/actions.js b/nuxt/store/actions.js index 68dc3239..140914d2 100644 --- a/nuxt/store/actions.js +++ b/nuxt/store/actions.js @@ -92,21 +92,14 @@ const actions = { }, addStore( { state }, - { - name: name, - description: description, - url: url, - uri: uri, - sector: sector, - digitalGoods: digitalGoods, - contributor: contributor, - recaptcha: recaptcha, - } + { contributor, description, lightningAccepted, name, recaptcha, uri, url } ) { - let params = { + const BTCLNMode = lightningAccepted ? ['payments'] : [] + + const params = { accepted: { BTC: { modes: ['payments'] }, - BTCLN: { modes: ['payments'] }, + BTCLN: { modes: BTCLNMode }, }, name: encodeURIComponent(name), description: encodeURIComponent(description), From d3dd08e8bf7d5866f30453fce6ac8f160ed6fb22 Mon Sep 17 00:00:00 2001 From: Engels Baca Sevilla Date: Wed, 18 Aug 2021 15:00:59 -0600 Subject: [PATCH 2/2] Refactor, deconstructing addDialogForm --- nuxt/components/AddStoreModal.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/nuxt/components/AddStoreModal.vue b/nuxt/components/AddStoreModal.vue index da54cd6c..8d64a785 100644 --- a/nuxt/components/AddStoreModal.vue +++ b/nuxt/components/AddStoreModal.vue @@ -296,15 +296,17 @@ export default { this.isLoading = true this.addAlert = { message: '', success: true } this.isPaid = false + + const { contributor, url, name, description, uri } = this.addDialogForm this.$store .dispatch('addStore', { - contributor: this.addDialogForm.contributor, - description: this.addDialogForm.description, + contributor, + description, lightningAccepted: this.lightningAccepted, - name: this.addDialogForm.name, + name, recaptcha: token, - uri: this.addDialogForm.uri, - url: this.addDialogForm.url, + uri, + url, }) .then( (response) => {