mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
fix build error - type errors
This commit is contained in:
parent
62ba171f80
commit
736310f5d5
@ -215,11 +215,11 @@ export class AdminResolver {
|
||||
if (!lastUserTransaction) {
|
||||
newBalance = 0
|
||||
} else {
|
||||
newBalance = await calculateDecay(
|
||||
newBalance = calculateDecay(
|
||||
lastUserTransaction.balance,
|
||||
lastUserTransaction.balanceDate,
|
||||
receivedCallDate,
|
||||
)
|
||||
).balance
|
||||
}
|
||||
newBalance = Number(newBalance) + Number(parseInt(pendingCreation.amount.toString()))
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ export class BalanceResolver {
|
||||
return new Balance({
|
||||
balance: roundFloorFrom4(balanceEntity.amount),
|
||||
decay: roundFloorFrom4(
|
||||
await calculateDecay(balanceEntity.amount, balanceEntity.recordDate, now),
|
||||
calculateDecay(balanceEntity.amount, balanceEntity.recordDate, now).balance,
|
||||
),
|
||||
decay_date: now.toString(),
|
||||
})
|
||||
|
||||
@ -21,7 +21,7 @@ async function hasUserAmount(user: dbUser, amount: number): Promise<boolean> {
|
||||
const balance = await balanceRepository.findOne({ userId: user.id })
|
||||
if (!balance) return false
|
||||
|
||||
const decay = await calculateDecay(balance.amount, balance.recordDate, new Date())
|
||||
const decay = calculateDecay(balance.amount, balance.recordDate, new Date()).balance
|
||||
return decay > amount
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user