mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
admin resolver: make sure to write userId only when we create a new balance
This commit is contained in:
parent
2f9cb42428
commit
ea3ecbc679
@ -261,9 +261,10 @@ export class AdminResolver {
|
||||
})
|
||||
|
||||
let userBalance = await Balance.findOne({ userId: pendingCreation.userId })
|
||||
|
||||
if (!userBalance) userBalance = new Balance()
|
||||
userBalance.userId = pendingCreation.userId
|
||||
if (!userBalance) {
|
||||
userBalance = new Balance()
|
||||
userBalance.userId = pendingCreation.userId
|
||||
}
|
||||
userBalance.amount = Number(newBalance)
|
||||
userBalance.modified = receivedCallDate
|
||||
userBalance.recordDate = receivedCallDate
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user