akkoma-fe/src/components/block_card/block_card.js

38 lines
732 B
JavaScript
Raw Normal View History

2019-02-13 19:55:02 +00:00
import BasicUserCard from '../basic_user_card/basic_user_card.vue'
const BlockCard = {
2019-02-13 20:31:20 +00:00
props: ['userId'],
2019-02-13 19:55:02 +00:00
data () {
return {
2019-02-13 20:31:20 +00:00
progress: false
}
},
computed: {
user () {
return this.$store.getters.userById(this.userId)
},
blocked () {
return this.user.statusnet_blocking
2019-02-13 19:55:02 +00:00
}
},
components: {
BasicUserCard
},
methods: {
unblockUser () {
this.progress = true
2019-02-13 20:31:20 +00:00
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
})
2019-02-13 19:55:02 +00:00
}
}
}
export default BlockCard