parent
d5e8315e83
commit
4cf402ff21
@ -1,26 +0,0 @@
|
||||
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
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<button
|
||||
@click.prevent="subscribe"
|
||||
class="btn btn-default follow-card-follow-button"
|
||||
:disabled="inProgress"
|
||||
v-if="!user.subscribing"
|
||||
>
|
||||
Subscribe
|
||||
</button>
|
||||
<button
|
||||
@click.prevent="unsubscribe"
|
||||
class="btn btn-default follow-card-follow-button pressed"
|
||||
:disabled="inProgress"
|
||||
v-else
|
||||
>
|
||||
Subscribing!
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script src="./subscribe_button.js"></script>
|
Loading…
Reference in new issue