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
|
this.$apollo
|
||||||
.mutate({
|
.mutate({
|
||||||
mutation: gql`
|
mutation: gql`
|
||||||
mutation($content: String!) {
|
mutation($postId: ID, $content: String!) {
|
||||||
CreateComment(content: $content) {
|
CreateComment(postId: $postId, content: $content) {
|
||||||
id
|
id
|
||||||
content
|
content
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
variables: {
|
variables: {
|
||||||
|
postId: this.post.id,
|
||||||
content: this.value
|
content: this.value
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.disabled = true
|
this.disabled = true
|
||||||
this.loading = false
|
this.loading = false
|
||||||
const { id } = res.data.CreateComment
|
this.$toast.success('Saved!')
|
||||||
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!')
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
this.$toast.error(err.message)
|
this.$toast.error(err.message)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user