bug fixed

This commit is contained in:
WildanFahri
2025-03-05 13:48:55 +07:00
parent e9e9bbf4c8
commit 530b5eed7e
@@ -301,11 +301,8 @@ const insertLoadingBalance = async (
.insert(data)
.returning('i_load_balance')
.then((resp) => {
console.log("resp insertLoadingBalance", resp)
let id = resp[0];
console.log("id resp insertLoadingBalance", id)
let loadDetail = [];
console.log("detail insertLoadingBalance", detail)
detail.forEach((element) => {
loadDetail.push({
i_load_balance: id,
@@ -336,9 +333,7 @@ const insertLoadingBalance = async (
.insert(data);
})
.then((history) => {
console.log("history insertLoadingBalance", history)
let id = history[0];
console.log("id history insertLoadingBalance", id)
let loadDetail = [];
detail.forEach((element) => {
loadDetail.push({
@@ -402,11 +397,21 @@ const insertLoadingBalance = async (
.catch(trx.rollback);
})
.then((result) => {
console.log("result insertLoadingBalance", result);
winston.logger.info(
`${uniqueCode} [ RESULT INSERT-LOADING-BALANCE ]: ${JSON.stringify(
result
)}`
);
// console.log("result insertLoadingBalance", result);
return result.rowCount;
})
.catch((error) => {
console.log("error.message insertLoadingBalance", error.message);
winston.logger.info(
`${uniqueCode} [ RESULT ERROR INSERT-LOADING-BALANCE ]: ${JSON.stringify(
error.message
)}`
);
// console.log("error.message insertLoadingBalance", error.message);
return error.message;
});
};