mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
add method updateState and emits
This commit is contained in:
parent
0cfd0f0097
commit
6bd02a2d4b
@ -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)
|
||||
})
|
||||
|
||||
@ -4,21 +4,13 @@
|
||||
{{ messages.lenght }}
|
||||
<div v-for="message in messages" v-bind:key="message.id">
|
||||
<contribution-messages-list-item :message="message" />
|
||||
|
||||
<!-- <contribution-messages-list-item :typeId="message.isModerator">
|
||||
<template #1>
|
||||
<is-moderator :message="message"></is-moderator>
|
||||
</template>
|
||||
<template #0>
|
||||
<is-not-moderator :message="message" class="text-right"></is-not-moderator>
|
||||
</template>
|
||||
</contribution-messages-list-item> -->
|
||||
</div>
|
||||
</b-container>
|
||||
|
||||
<contribution-messages-formular
|
||||
:contributionId="contributionId"
|
||||
@get-list-contribution-messages="getListContributionMessages"
|
||||
@update-state="updateState"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@ -46,7 +38,6 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
getListContributionMessages(id) {
|
||||
// console.log('getListContributionMessages', id)
|
||||
this.messages = []
|
||||
this.$apollo
|
||||
.query({
|
||||
@ -57,13 +48,15 @@ export default {
|
||||
fetchPolicy: 'no-cache',
|
||||
})
|
||||
.then((result) => {
|
||||
// console.log('result', result.data.listContributionMessages)
|
||||
this.messages = result.data.listContributionMessages.messages
|
||||
})
|
||||
.catch((error) => {
|
||||
this.toastError(error.message)
|
||||
})
|
||||
},
|
||||
updateState(id) {
|
||||
this.$emit('update-state', id)
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getListContributionMessages(this.contributionId)
|
||||
|
||||
@ -57,11 +57,14 @@
|
||||
:row="row"
|
||||
:creationUserData="creationUserData"
|
||||
@update-creation-data="updateCreationData"
|
||||
@update-user-data="updateUserData"
|
||||
/>
|
||||
</div>
|
||||
<div v-else>
|
||||
<contribution-messages-list :contributionId="row.item.id" />
|
||||
<contribution-messages-list
|
||||
:contributionId="row.item.id"
|
||||
@update-state="updateState"
|
||||
@update-user-data="updateUserData"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</row-details>
|
||||
@ -116,6 +119,9 @@ export default {
|
||||
updateUserData(rowItem, newCreation) {
|
||||
rowItem.creation = newCreation
|
||||
},
|
||||
updateState(id) {
|
||||
this.$emit('update-state', id)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
:fields="fields"
|
||||
@remove-creation="removeCreation"
|
||||
@show-overlay="showOverlay"
|
||||
@update-state="updateState"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@ -79,6 +80,7 @@ export default {
|
||||
.then((result) => {
|
||||
this.$store.commit('resetOpenCreations')
|
||||
this.pendingCreations = result.data.listUnconfirmedContributions
|
||||
console.log(this.pendingCreations)
|
||||
this.$store.commit('setOpenCreations', result.data.listUnconfirmedContributions.length)
|
||||
})
|
||||
.catch((error) => {
|
||||
@ -93,6 +95,11 @@ export default {
|
||||
this.overlay = true
|
||||
this.item = item
|
||||
},
|
||||
updateState(id) {
|
||||
console.log('admin updateState', id)
|
||||
console.log(this.pendingCreations)
|
||||
this.pendingCreations.find((item) => item.id === id).state = 'IN_PROGRESS'
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
fields() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user