mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
add apollo mutation adminCreateContributionMessage
This commit is contained in:
parent
250c444722
commit
7bc82db3c4
@ -34,8 +34,16 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { adminCreateContributionMessage } from '@/graphql/adminCreateContributionMessage'
|
||||
|
||||
export default {
|
||||
name: 'ContributionMessagesFormular',
|
||||
props: {
|
||||
contributionId: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
@ -46,7 +54,20 @@ export default {
|
||||
methods: {
|
||||
onSubmit(event) {
|
||||
event.preventDefault()
|
||||
alert(JSON.stringify(this.form))
|
||||
this.$apollo
|
||||
.mutate({
|
||||
mutation: adminCreateContributionMessage,
|
||||
variables: {
|
||||
contributionId: this.contributionId,
|
||||
message: this.form.text,
|
||||
},
|
||||
})
|
||||
.then((result) => {
|
||||
this.toastSuccess(result)
|
||||
})
|
||||
.catch((error) => {
|
||||
this.toastError(error.message)
|
||||
})
|
||||
},
|
||||
onReset(event) {
|
||||
event.preventDefault()
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<contribution-messages-formular />
|
||||
<contribution-messages-formular :contributionId="contributionId" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@ -26,6 +26,12 @@ import ContributionMessagesFormular from '../ContributionMessages/ContributionMe
|
||||
|
||||
export default {
|
||||
name: 'ContributionMessagesList',
|
||||
props: {
|
||||
contributionId: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
components: {
|
||||
ContributionMessagesListItem,
|
||||
IsModerator,
|
||||
|
||||
@ -52,7 +52,7 @@
|
||||
/>
|
||||
</div>
|
||||
<div v-else>
|
||||
<contribution-messages-list />
|
||||
<contribution-messages-list :contributionId="row.item.id" />
|
||||
</div>
|
||||
</template>
|
||||
</row-details>
|
||||
|
||||
15
admin/src/graphql/adminCreateContributionMessage.js
Normal file
15
admin/src/graphql/adminCreateContributionMessage.js
Normal file
@ -0,0 +1,15 @@
|
||||
import gql from 'graphql-tag'
|
||||
|
||||
export const adminCreateContributionMessage = gql`
|
||||
mutation ($contributionId: Float!, $message: String!) {
|
||||
adminCreateContributionMessage(contributionId: $contributionId, message: $message) {
|
||||
id
|
||||
message
|
||||
createdAt
|
||||
updatedAt
|
||||
type
|
||||
userFirstName
|
||||
userLastName
|
||||
}
|
||||
}
|
||||
`
|
||||
Loading…
x
Reference in New Issue
Block a user