mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Update frontend
- to work with new backend implementation
This commit is contained in:
parent
4dc39a97a8
commit
86d075292c
@ -1,18 +0,0 @@
|
||||
import gql from 'graphql-tag'
|
||||
|
||||
export default app => {
|
||||
return {
|
||||
AddPostComments: gql(`
|
||||
mutation($from: _CommentInput!, $to: _PostInput!) {
|
||||
AddPostComments(from: $from, to: $to) {
|
||||
from {
|
||||
id
|
||||
}
|
||||
to {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`)
|
||||
}
|
||||
}
|
||||
@ -321,38 +321,22 @@ export default {
|
||||
this.$apollo
|
||||
.mutate({
|
||||
mutation: gql`
|
||||
mutation($content: String!) {
|
||||
CreateComment(content: $content) {
|
||||
mutation($postId: ID, $content: String!) {
|
||||
CreateComment(postId: $postId, content: $content) {
|
||||
id
|
||||
content
|
||||
}
|
||||
}
|
||||
`,
|
||||
variables: {
|
||||
postId: this.post.id,
|
||||
content: this.value
|
||||
}
|
||||
})
|
||||
.then(res => {
|
||||
this.disabled = true
|
||||
this.loading = false
|
||||
const { id } = res.data.CreateComment
|
||||
const commentId = { id: id }
|
||||
const postId = { id: this.post.id }
|
||||
const AddPostComments = require('~/graphql/AddPostComments.js').default(
|
||||
this
|
||||
)
|
||||
|
||||
this.$apollo
|
||||
.mutate({
|
||||
mutation: AddPostComments.AddPostComments,
|
||||
variables: {
|
||||
from: commentId,
|
||||
to: postId
|
||||
}
|
||||
})
|
||||
.then(res => {
|
||||
this.$toast.success('Saved!')
|
||||
})
|
||||
this.$toast.success('Saved!')
|
||||
})
|
||||
.catch(err => {
|
||||
this.$toast.error(err.message)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user