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) {
|
if (!lastUserTransaction) {
|
||||||
newBalance = 0
|
newBalance = 0
|
||||||
} else {
|
} else {
|
||||||
newBalance = await calculateDecay(
|
newBalance = calculateDecay(
|
||||||
lastUserTransaction.balance,
|
lastUserTransaction.balance,
|
||||||
lastUserTransaction.balanceDate,
|
lastUserTransaction.balanceDate,
|
||||||
receivedCallDate,
|
receivedCallDate,
|
||||||
)
|
).balance
|
||||||
}
|
}
|
||||||
newBalance = Number(newBalance) + Number(parseInt(pendingCreation.amount.toString()))
|
newBalance = Number(newBalance) + Number(parseInt(pendingCreation.amount.toString()))
|
||||||
|
|
||||||
|
|||||||
@ -35,7 +35,7 @@ export class BalanceResolver {
|
|||||||
return new Balance({
|
return new Balance({
|
||||||
balance: roundFloorFrom4(balanceEntity.amount),
|
balance: roundFloorFrom4(balanceEntity.amount),
|
||||||
decay: roundFloorFrom4(
|
decay: roundFloorFrom4(
|
||||||
await calculateDecay(balanceEntity.amount, balanceEntity.recordDate, now),
|
calculateDecay(balanceEntity.amount, balanceEntity.recordDate, now).balance,
|
||||||
),
|
),
|
||||||
decay_date: now.toString(),
|
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 })
|
const balance = await balanceRepository.findOne({ userId: user.id })
|
||||||
if (!balance) return false
|
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
|
return decay > amount
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user