Use new shout mutation

This commit is contained in:
Grzegorz Leoniec 2019-03-05 11:19:23 +01:00
parent 76c4e4cd8f
commit c40f6521d1
No known key found for this signature in database
GPG Key ID: 3AA43686D4EB1377

View File

@ -44,23 +44,21 @@ export default {
this.$apollo
.mutate({
mutation: gql`
mutation($myId: ID!, $postId: ID!) {
AddUserShouted(from: { id: $myId }, to: { id: $postId }) {
from {
id
}
}
mutation($id: ID!) {
shout(id: $id, type: Post)
}
`,
variables: {
myId: this.$store.getters['auth/user'].id,
postId: this.postId
id: this.postId
}
})
.then(() => {
.then(res => {
console.log(res)
this.loading = false
this.disabled = true
this.shoutedCount++
if (res && res.data && res.data.shout) {
this.shoutedCount++
}
this.$emit('update')
})
}