aboutsummaryrefslogtreecommitdiff
path: root/src/components/subscribe_button/subscribe_button.js
diff options
context:
space:
mode:
authorjared <jaredrmain@gmail.com>2019-04-16 10:13:26 -0400
committertaehoon <th.dev91@gmail.com>2019-07-10 21:01:07 -0400
commitd5e8315e83327c7b8dda71eca5dd1c9d7d0a23dc (patch)
tree9c73e4d96dd67de137c28132afba2fd7bf0c31a0 /src/components/subscribe_button/subscribe_button.js
parentf2c95f9d0bcb9fd6640d8c5d38ce6fff111b70df (diff)
#482 - add subscribe button
Diffstat (limited to 'src/components/subscribe_button/subscribe_button.js')
-rw-r--r--src/components/subscribe_button/subscribe_button.js26
1 files changed, 26 insertions, 0 deletions
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
+ })
+ }
+ }
+}