mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
setup open creations query for admin
This commit is contained in:
parent
c7e7595f18
commit
7be971b81f
@ -75,6 +75,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import { adminUpdateContribution } from '../graphql/adminUpdateContribution'
|
||||
import { openCreations } from '../graphql/openCreations'
|
||||
import { creationMonths } from '../mixins/creationMonths'
|
||||
|
||||
export default {
|
||||
@ -96,10 +97,6 @@ export default {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
creation: {
|
||||
type: Array,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -108,6 +105,7 @@ export default {
|
||||
rangeMin: 0,
|
||||
rangeMax: 1000,
|
||||
selected: '',
|
||||
creation: [0, 0, 0],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -151,6 +149,25 @@ export default {
|
||||
})
|
||||
},
|
||||
},
|
||||
apollo: {
|
||||
OpenCreations: {
|
||||
query() {
|
||||
return openCreations
|
||||
},
|
||||
fetchPolicy: 'network-only',
|
||||
variables() {
|
||||
return {
|
||||
userId: this.item.userId,
|
||||
}
|
||||
},
|
||||
update({ openCreations }) {
|
||||
this.creation = openCreations.map((c) => c.amount)
|
||||
},
|
||||
error({ message }) {
|
||||
this.toastError(message)
|
||||
},
|
||||
},
|
||||
},
|
||||
created() {
|
||||
if (this.creationUserData.date) {
|
||||
const month = this.$d(new Date(this.creationUserData.date), 'month')
|
||||
|
||||
@ -92,7 +92,6 @@
|
||||
<div v-if="row.item.moderator">
|
||||
<edit-creation-formular
|
||||
type="singleCreation"
|
||||
:creation="row.item.creation"
|
||||
:item="row.item"
|
||||
:row="row"
|
||||
:creationUserData="creationUserData"
|
||||
|
||||
11
admin/src/graphql/openCreations.js
Normal file
11
admin/src/graphql/openCreations.js
Normal file
@ -0,0 +1,11 @@
|
||||
import gql from 'graphql-tag'
|
||||
|
||||
export const openCreations = gql`
|
||||
query ($userId: Int) {
|
||||
openCreations(userId: $userID) {
|
||||
year
|
||||
month
|
||||
amount
|
||||
}
|
||||
}
|
||||
`
|
||||
Loading…
x
Reference in New Issue
Block a user