Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Commit

Permalink
refactor: adjusted deposit ledger editing route to fit new db format
Browse files Browse the repository at this point in the history
  • Loading branch information
kndonetm committed Nov 15, 2023
1 parent 49aead0 commit 9c98706
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/routes/deposit-ledgers.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,19 @@ router.patch('/:txID', async (req, res, next) => {
const query = {
'ledger.$.ORNumber': req.body.ORNumber,
'ledger.$.transactionDate': req.body.transactionDate,
'ledger.$.amountReceived': req.body.amountReceived,
'ledger.$.amountWithdrawn': req.body.amountWithdrawn,
'ledger.$.submissionDate': req.body.submissionDate,
'ledger.$.depositType': req.body.depositType,
'ledger.$.amount': req.body.amount,
'ledger.$.interest': req.body.interest,
'ledger.$.balance': req.body.balance
}
if (req.body.officerInCharge) {
Object.assign(query, {
'ledger.$.officerInCharge.given': req.body.officerInCharge.given,
'ledger.$.officerInCharge.middle': req.body.officerInCharge.middle,
'ledger.$.officerInCharge.last': req.body.officerInCharge.last
})
}

try {
// Update deposit
Expand Down

0 comments on commit 9c98706

Please sign in to comment.