bug fixing

This commit is contained in:
WildanFahri
2025-03-05 12:35:42 +07:00
parent c17e56731f
commit cc497f606b
@@ -300,10 +300,11 @@ const insertLoadingBalance = async (
.transacting(trx)
.insert(data)
.returning('i_load_balance')
console.log("resp insertLoadingBalance", resp)
.then((resp) => {
console.log("resp insertLoadingBalance", resp)
let id = resp[0];
let loadDetail = [];
console.log("detail insertLoadingBalance", detail)
detail.forEach((element) => {
loadDetail.push({
i_load_balance: id.i_load_balance,
@@ -334,6 +335,7 @@ const insertLoadingBalance = async (
.insert(data);
})
.then((history) => {
console.log("history insertLoadingBalance", history)
let id = history[0];
let loadDetail = [];
detail.forEach((element) => {
@@ -398,11 +400,11 @@ const insertLoadingBalance = async (
.catch(trx.rollback);
})
.then((result) => {
console.log(result);
console.log("result insertLoadingBalance", result);
return result.rowCount;
})
.catch((error) => {
console.log(error.message);
console.log("error.message insertLoadingBalance", error.message);
return error.message;
});
};