mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge pull request #1276 from gradido/fix-admin-creation-list
fix: Admin Creation List
This commit is contained in:
commit
85f5b000e1
@ -8,7 +8,7 @@ const apolloQueryMock = jest.fn().mockResolvedValue({
|
||||
transactionList: {
|
||||
transactions: [
|
||||
{
|
||||
type: 'created',
|
||||
type: 'creation',
|
||||
balance: 100,
|
||||
decayStart: 0,
|
||||
decayEnd: 0,
|
||||
@ -27,7 +27,7 @@ const apolloQueryMock = jest.fn().mockResolvedValue({
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'created',
|
||||
type: 'creation',
|
||||
balance: 200,
|
||||
decayStart: 0,
|
||||
decayEnd: 0,
|
||||
|
||||
@ -30,7 +30,7 @@ export default {
|
||||
},
|
||||
})
|
||||
.then((result) => {
|
||||
this.items = result.data.transactionList.transactions
|
||||
this.items = result.data.transactionList.transactions.filter((t) => t.type === 'creation')
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$toasted.error(error.message)
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { EntityRepository, Repository } from 'typeorm'
|
||||
import { Order } from '../../graphql/enum/Order'
|
||||
import { UserTransaction } from '@entity/UserTransaction'
|
||||
import { TransactionTypeId } from '../../graphql/enum/TransactionTypeId'
|
||||
|
||||
@EntityRepository(UserTransaction)
|
||||
export class UserTransactionRepository extends Repository<UserTransaction> {
|
||||
@ -14,7 +15,9 @@ export class UserTransactionRepository extends Repository<UserTransaction> {
|
||||
if (onlyCreation) {
|
||||
return this.createQueryBuilder('userTransaction')
|
||||
.where('userTransaction.userId = :userId', { userId })
|
||||
.andWhere('userTransaction.type = "creation"')
|
||||
.andWhere('userTransaction.transactionTypeId = :transactionTypeId', {
|
||||
transactionTypeId: TransactionTypeId.CREATION,
|
||||
})
|
||||
.orderBy('userTransaction.balanceDate', order)
|
||||
.limit(limit)
|
||||
.offset(offset)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user