Complete functionality of BlockCard

This commit is contained in:
taehoon 2019-02-13 15:31:20 -05:00
parent 0220d3d304
commit 52913d8f87
5 changed files with 39 additions and 6 deletions

View file

@ -1,11 +1,18 @@
import BasicUserCard from '../basic_user_card/basic_user_card.vue'
const BlockCard = {
props: ['user'],
props: ['userId'],
data () {
return {
progress: false,
updated: false
progress: false
}
},
computed: {
user () {
return this.$store.getters.userById(this.userId)
},
blocked () {
return this.user.statusnet_blocking
}
},
components: {
@ -14,6 +21,15 @@ const BlockCard = {
methods: {
unblockUser () {
this.progress = true
this.$store.dispatch('unblockUser', this.user.id).then(() => {
this.progress = false
})
},
blockUser () {
this.progress = true
this.$store.dispatch('blockUser', this.user.id).then(() => {
this.progress = false
})
}
}
}