mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Update method name to be more descriptive/accurate
This commit is contained in:
parent
31c8b6e35d
commit
d1c8682710
@ -92,7 +92,7 @@ export default {
|
||||
}
|
||||
})
|
||||
.then(res => {
|
||||
this.$root.$emit('addComment', res.data.CreateComment)
|
||||
this.$root.$emit('refetchPostComments', res.data.CreateComment)
|
||||
this.$refs.editor.clear()
|
||||
this.$toast.success(this.$t('post.comment.submitted'))
|
||||
})
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
</div>
|
||||
<hc-empty
|
||||
v-else
|
||||
name="empty"
|
||||
icon="messages"
|
||||
/>
|
||||
</div>
|
||||
@ -44,21 +45,21 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
comments: null
|
||||
comments: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
Post(post) {
|
||||
this.comments = post[0].comments || {}
|
||||
this.comments = post[0].comments || []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$root.$on('addComment', comment => {
|
||||
this.addComment(comment)
|
||||
this.$root.$on('refetchPostComments', comment => {
|
||||
this.refetchPostComments(comment)
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
addComment(comment) {
|
||||
refetchPostComments(comment) {
|
||||
this.$apollo.queries.Post.refetch()
|
||||
}
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user