diff --git a/backend/src/typeorm/repository/UserTransaction.ts b/backend/src/typeorm/repository/UserTransaction.ts index 87166fcfc..57f89d5a5 100644 --- a/backend/src/typeorm/repository/UserTransaction.ts +++ b/backend/src/typeorm/repository/UserTransaction.ts @@ -9,7 +9,17 @@ export class UserTransactionRepository extends Repository { limit: number, offset: number, order: Order, + onlyCreation?: boolean, ): Promise<[UserTransaction[], number]> { + if (onlyCreation) { + return this.createQueryBuilder('userTransaction') + .where('userTransaction.userId = :userId', { userId }) + .andWhere('userTransaction.type = "creation"') + .orderBy('userTransaction.balanceDate', order) + .limit(limit) + .offset(offset) + .getManyAndCount() + } return this.createQueryBuilder('userTransaction') .where('userTransaction.userId = :userId', { userId }) .orderBy('userTransaction.balanceDate', order)