Wolfgang Huß 1339734281 Rename DeleteModal to ConfirmModel and write some refactor some tests
Co-Authored-By: mattwr18 <mattwr18@gmail.com>
2019-06-12 18:02:50 +02:00

44 lines
949 B
JavaScript

import gql from 'graphql-tag'
export default {
postMenuModalsData(truncatedPostName, confirmCallback, cancelCallback = () => {}) {
return {
delete: {
titleIdent: 'delete.contribution.title',
messageIdent: 'delete.contribution.message',
messageParams: {
name: truncatedPostName,
},
buttons: {
confirm: {
danger: true,
icon: 'trash',
textIdent: 'delete.submit',
callback: confirmCallback,
},
cancel: {
icon: 'close',
textIdent: 'delete.cancel',
callback: cancelCallback,
},
},
},
}
},
deletePostMutationData(postId) {
var gqlMutation = gql`
mutation($id: ID!) {
DeletePost(id: $id) {
id
}
}
`
return {
mutation: gqlMutation,
variables: {
id: postId,
},
}
},
}