diff --git a/frontend/src/components/ContributionMessages/ContributionMessagesFormular.vue b/frontend/src/components/ContributionMessages/ContributionMessagesFormular.vue index 80708726c..7ec3c4ff9 100644 --- a/frontend/src/components/ContributionMessages/ContributionMessagesFormular.vue +++ b/frontend/src/components/ContributionMessages/ContributionMessagesFormular.vue @@ -52,6 +52,7 @@ export default { }) .then((result) => { this.$emit('get-list-contribution-messages', this.contributionId) + this.$emit('update-state', this.contributionId) this.form.text = '' this.toastSuccess(result) }) diff --git a/frontend/src/components/ContributionMessages/ContributionMessagesList.vue b/frontend/src/components/ContributionMessages/ContributionMessagesList.vue index 98e92e6e7..896487160 100644 --- a/frontend/src/components/ContributionMessages/ContributionMessagesList.vue +++ b/frontend/src/components/ContributionMessages/ContributionMessagesList.vue @@ -10,6 +10,7 @@ class="mt-5" :contributionId="contributionId" @get-list-contribution-messages="getListContributionMessages" + @update-state="updateState" /> @@ -41,6 +42,9 @@ export default { getListContributionMessages() { this.$emit('get-list-contribution-messages', this.contributionId) }, + updateState(id) { + this.$emit('update-state', id) + }, }, } diff --git a/frontend/src/components/Contributions/ContributionList.vue b/frontend/src/components/Contributions/ContributionList.vue index 724a69281..11cc0f9dd 100644 --- a/frontend/src/components/Contributions/ContributionList.vue +++ b/frontend/src/components/Contributions/ContributionList.vue @@ -6,6 +6,7 @@ :contributionId="item.id" @update-contribution-form="updateContributionForm" @delete-contribution="deleteContribution" + @update-state="updateState" /> @@ -186,6 +187,9 @@ export default { this.toastError(error.message) }) }, + updateState(id) { + this.$emit('update-state', id) + }, }, } diff --git a/frontend/src/pages/Community.vue b/frontend/src/pages/Community.vue index 5f9eb57f6..1753ca5d2 100644 --- a/frontend/src/pages/Community.vue +++ b/frontend/src/pages/Community.vue @@ -43,6 +43,7 @@ @update-list-contributions="updateListContributions" @update-contribution-form="updateContributionForm" @delete-contribution="deleteContribution" + @update-state="updateState" :contributionCount="contributionCount" :showPagination="true" :pageSize="pageSize" @@ -259,6 +260,9 @@ export default { updateTransactions(pagination) { this.$emit('update-transactions', pagination) }, + updateState(id) { + this.items.find((item) => item.id === id).state = 'PENDING' + }, }, created() { // verifyLogin is important at this point so that creation is updated on reload if they are deleted in a session in the admin area.