aboutsummaryrefslogtreecommitdiff
path: root/src/components/subscribe_button/subscribe_button.js
diff options
context:
space:
mode:
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
+ })
+ }
+ }
+}