diff --git a/admin/src/components/CreationTransactionListFormular.spec.js b/admin/src/components/CreationTransactionListFormular.spec.js index 1c7b81c25..32dcb6c9d 100644 --- a/admin/src/components/CreationTransactionListFormular.spec.js +++ b/admin/src/components/CreationTransactionListFormular.spec.js @@ -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, diff --git a/admin/src/components/CreationTransactionListFormular.vue b/admin/src/components/CreationTransactionListFormular.vue index d3ffc3e29..7fed4adcc 100644 --- a/admin/src/components/CreationTransactionListFormular.vue +++ b/admin/src/components/CreationTransactionListFormular.vue @@ -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) diff --git a/backend/src/typeorm/repository/UserTransaction.ts b/backend/src/typeorm/repository/UserTransaction.ts index 57f89d5a5..386145d03 100644 --- a/backend/src/typeorm/repository/UserTransaction.ts +++ b/backend/src/typeorm/repository/UserTransaction.ts @@ -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 { @@ -14,7 +15,9 @@ export class UserTransactionRepository extends Repository { 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)