In my database, there is a function that adds ledger entries. Entries that meet specific criteria are saved to an array. However, when it comes to saving records in the 'if' block, only the second part gets saved successfully. How can I modify the code to save both types of ledgers from the 'if' block into the array?
//Function for pushing the ledger
.......
for (let i = 0; i < myledger.length; i++) {
if (myledger[i].type === 'test' || myledger[i].type === 'Security'
|| myledger[i].type === 'Books'){
myledger.push(i)
}
if(status === active){
record {
type: "Books",
Fee: 3000
},
record {
type: "Security",
Fee: 1000
},
}
else {
record {
type: "test",
Fee: 10000
}
}