mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge pull request #1892 from gradido/count-depricated-links-as-well
fix: Count Deprecated Links as Well
This commit is contained in:
commit
645e3f35cc
@ -7,7 +7,7 @@ import { Transaction as dbTransaction } from '@entity/Transaction'
|
||||
import Decimal from 'decimal.js-light'
|
||||
import { GdtResolver } from './GdtResolver'
|
||||
import { TransactionLink as dbTransactionLink } from '@entity/TransactionLink'
|
||||
import { MoreThan, getCustomRepository } from '@dbTools/typeorm'
|
||||
import { getCustomRepository } from '@dbTools/typeorm'
|
||||
import { TransactionLinkRepository } from '@repository/TransactionLink'
|
||||
|
||||
@Resolver()
|
||||
@ -39,16 +39,13 @@ export class BalanceResolver {
|
||||
context.transactionCount || context.transactionCount === 0
|
||||
? context.transactionCount
|
||||
: await dbTransaction.count({ where: { userId: user.id } })
|
||||
const linkCount =
|
||||
context.linkCount || context.linkCount === 0
|
||||
? context.linkCount
|
||||
: await dbTransactionLink.count({
|
||||
where: {
|
||||
userId: user.id,
|
||||
redeemedAt: null,
|
||||
validUntil: MoreThan(new Date()),
|
||||
},
|
||||
})
|
||||
const linkCount = await dbTransactionLink.count({
|
||||
where: {
|
||||
userId: user.id,
|
||||
redeemedAt: null,
|
||||
// validUntil: MoreThan(new Date()),
|
||||
},
|
||||
})
|
||||
|
||||
// The decay is always calculated on the last booked transaction
|
||||
const calculatedDecay = calculateDecay(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user