From d5e8315e83327c7b8dda71eca5dd1c9d7d0a23dc Mon Sep 17 00:00:00 2001 From: jared Date: Tue, 16 Apr 2019 10:13:26 -0400 Subject: #482 - add subscribe button --- .../subscribe_button/subscribe_button.js | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/components/subscribe_button/subscribe_button.js (limited to 'src/components/subscribe_button/subscribe_button.js') diff --git a/src/components/subscribe_button/subscribe_button.js b/src/components/subscribe_button/subscribe_button.js new file mode 100644 index 00000000..e3a2842c --- /dev/null +++ b/src/components/subscribe_button/subscribe_button.js @@ -0,0 +1,26 @@ +export default { + props: [ 'user' ], + data () { + return { + inProgress: false + } + }, + methods: { + subscribe () { + this.inProgress = true + this.$store.state.api.backendInteractor.subscribeUser(this.user.id) + .then((updated) => { + console.log(updated) + this.inProgress = false + }) + }, + unsubscribe () { + this.inProgress = true + this.$store.state.api.backendInteractor.unsubscribeUser(this.user.id) + .then((updated) => { + console.log(updated) + this.inProgress = false + }) + } + } +} -- cgit v1.2.3-70-g09d2