mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Add button to deny contribution in the admin interface
This commit is contained in:
parent
493aa32011
commit
b88bfabb78
@ -8,7 +8,7 @@
|
||||
@click="$emit('remove-creation', row.item)"
|
||||
class="mr-2"
|
||||
>
|
||||
<b-icon icon="x" variant="light"></b-icon>
|
||||
<b-icon icon="trash" variant="light"></b-icon>
|
||||
</b-button>
|
||||
</template>
|
||||
<template #cell(editCreation)="row">
|
||||
@ -49,6 +49,18 @@
|
||||
</b-button>
|
||||
</div>
|
||||
</template>
|
||||
<template #cell(deny)="row">
|
||||
<div v-if="$store.state.moderator.id !== row.item.userId">
|
||||
<b-button
|
||||
variant="danger"
|
||||
size="md"
|
||||
@click="$emit('reject-creation', row.item)"
|
||||
class="mr-2"
|
||||
>
|
||||
<b-icon icon="x" variant="light"></b-icon>
|
||||
</b-button>
|
||||
</div>
|
||||
</template>
|
||||
<template #row-details="row">
|
||||
<row-details
|
||||
:row="row"
|
||||
|
||||
7
admin/src/graphql/rejectContribution.js
Normal file
7
admin/src/graphql/rejectContribution.js
Normal file
@ -0,0 +1,7 @@
|
||||
import gql from 'graphql-tag'
|
||||
|
||||
export const rejectContribution = gql`
|
||||
mutation ($id: Int!) {
|
||||
rejectContribution(id: $id)
|
||||
}
|
||||
`
|
||||
@ -7,6 +7,7 @@
|
||||
class="mt-4"
|
||||
:items="pendingCreations"
|
||||
:fields="fields"
|
||||
@reject-creation="rejectCreation"
|
||||
@remove-creation="removeCreation"
|
||||
@show-overlay="showOverlay"
|
||||
@update-state="updateState"
|
||||
@ -20,6 +21,7 @@ import OpenCreationsTable from '../components/Tables/OpenCreationsTable.vue'
|
||||
import { listUnconfirmedContributions } from '../graphql/listUnconfirmedContributions'
|
||||
import { adminDeleteContribution } from '../graphql/adminDeleteContribution'
|
||||
import { confirmContribution } from '../graphql/confirmContribution'
|
||||
import { rejectContribution } from '../graphql/rejectContribution'
|
||||
|
||||
export default {
|
||||
name: 'CreationConfirm',
|
||||
@ -35,6 +37,25 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
rejectCreation(item) {
|
||||
this.$bvModal.msgBoxConfirm(this.$t('creation_form.rejectNow')).then(async (value) => {
|
||||
if (value) {
|
||||
await this.$apollo
|
||||
.mutate({
|
||||
mutation: rejectContribution,
|
||||
variables: {
|
||||
id: item.id,
|
||||
},
|
||||
})
|
||||
.then((result) => {
|
||||
this.toastSuccess(this.$t('creation_form.toasted_rejected'))
|
||||
})
|
||||
.catch((error) => {
|
||||
this.toastError(error.message)
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
removeCreation(item) {
|
||||
this.$bvModal.msgBoxConfirm(this.$t('creation_form.deleteNow')).then(async (value) => {
|
||||
if (value)
|
||||
@ -110,6 +131,7 @@ export default {
|
||||
{ key: 'moderator', label: this.$t('moderator') },
|
||||
{ key: 'editCreation', label: this.$t('edit') },
|
||||
{ key: 'confirm', label: this.$t('save') },
|
||||
{ key: 'deny', label: this.$t('deny') },
|
||||
]
|
||||
},
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user