mirror of
https://git.youjo.love/youjo/youjo-fe.git
synced 2025-02-12 00:13:38 +01:00
37 lines
732 B
JavaScript
37 lines
732 B
JavaScript
import BasicUserCard from '../basic_user_card/basic_user_card.vue'
|
|
|
|
const BlockCard = {
|
|
props: ['userId'],
|
|
data () {
|
|
return {
|
|
progress: false
|
|
}
|
|
},
|
|
computed: {
|
|
user () {
|
|
return this.$store.getters.userById(this.userId)
|
|
},
|
|
blocked () {
|
|
return this.user.statusnet_blocking
|
|
}
|
|
},
|
|
components: {
|
|
BasicUserCard
|
|
},
|
|
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
|
|
})
|
|
}
|
|
}
|
|
}
|
|
|
|
export default BlockCard
|