mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
statistics for field resolvers
This commit is contained in:
parent
7781011b1a
commit
6b1497a988
@ -4,12 +4,14 @@ export const communityStatistics = gql`
|
||||
query {
|
||||
communityStatistics {
|
||||
totalUsers
|
||||
activeUsers
|
||||
deletedUsers
|
||||
totalGradidoCreated
|
||||
totalGradidoDecayed
|
||||
totalGradidoAvailable
|
||||
totalGradidoUnbookedDecayed
|
||||
totalAvailable {
|
||||
activeUsers
|
||||
totalGradidoAvailable
|
||||
totalGradidoUnbookedDecayed
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
@ -17,12 +17,14 @@ const defaultData = () => {
|
||||
return {
|
||||
communityStatistics: {
|
||||
totalUsers: 3113,
|
||||
activeUsers: 1057,
|
||||
deletedUsers: 35,
|
||||
totalGradidoCreated: '4083774.05000000000000000000',
|
||||
totalGradidoDecayed: '-1062639.13634129622923372197',
|
||||
totalGradidoAvailable: '2513565.869444365732411569',
|
||||
totalGradidoUnbookedDecayed: '-500474.6738366222166261272',
|
||||
totalAvailable: {
|
||||
activeUsers: 1057,
|
||||
totalGradidoAvailable: '2513565.869444365732411569',
|
||||
totalGradidoUnbookedDecayed: '-500474.6738366222166261272',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,7 +31,13 @@ export default {
|
||||
return communityStatistics
|
||||
},
|
||||
update({ communityStatistics }) {
|
||||
this.statistics = communityStatistics
|
||||
const totals = { ...communityStatistics.totalAvailable }
|
||||
this.statistics = { ...communityStatistics, ...totals }
|
||||
this.activeUsers = this.statistics.totalAvailable.activeUsers
|
||||
this.totalGradidoAvailable = this.statistics.totalAvailable.totalGradidoAvailable
|
||||
this.totalGradidoUnbookedDecayed =
|
||||
this.statistics.totalAvailable.totalGradidoUnbookedDecayed
|
||||
delete this.totalAvailable
|
||||
},
|
||||
error({ message }) {
|
||||
this.toastError(message)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user