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

Commit

Permalink
refactor: change setting values to Decimal type
Browse files Browse the repository at this point in the history
  • Loading branch information
kndonetm committed Nov 23, 2023
1 parent a575aed commit a4cb547
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/models/individualSettingSchema.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Packages
import { Schema } from 'mongoose'
import { Schema, Decimal128 } from 'mongoose'

const InvidualSettingSchema = new Schema(
{
Expand All @@ -8,7 +8,7 @@ const InvidualSettingSchema = new Schema(
required: true
},
value: {
type: Number,
type: Decimal128,
default: 0
},
enabled: {
Expand Down
5 changes: 5 additions & 0 deletions src/routes/loans.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,11 @@ router.post('/:loanID/review', async (req, res, next) => {

// Fetch settings
const settings = await LoanSettings.findOne().lean()

console.log(settings)
parseDecimal(settings)
console.log(settings)

if (!settings[existingLoan.loanType]) {
return res.status(400).json({
message: 'No loan settings exist for the current loan type',
Expand Down

0 comments on commit a4cb547

Please sign in to comment.