mirror of
https://github.com/mohamadihsan/topuponline.git
synced 2026-12-06 22:06:27 +00:00
update
This commit is contained in:
@@ -508,23 +508,48 @@ const loadingBalanceRequest = async (req, res) => {
|
||||
);
|
||||
|
||||
// update status to in progress
|
||||
await model.updateStatusReservation(reservationNumberTemp, now, flag);
|
||||
|
||||
result = {
|
||||
code: '00',
|
||||
message: 'reservation exists',
|
||||
data: {
|
||||
amount: amountTopup,
|
||||
total_reservation: totalReservation,
|
||||
reservation_number: reservationNumber,
|
||||
},
|
||||
};
|
||||
|
||||
// log info
|
||||
winston.logger.info(
|
||||
`${uniqueCode} RESPONSE load balance validate: ${JSON.stringify(result)}`
|
||||
let updateStatusReservation = await model.updateStatusReservation(
|
||||
reservationNumberTemp,
|
||||
now,
|
||||
flag
|
||||
);
|
||||
|
||||
if (updateStatusReservation) {
|
||||
result = {
|
||||
code: '00',
|
||||
message: 'reservation exists',
|
||||
data: {
|
||||
amount: amountTopup,
|
||||
total_reservation: totalReservation,
|
||||
reservation_number: reservationNumber,
|
||||
},
|
||||
};
|
||||
|
||||
// log info
|
||||
winston.logger.info(
|
||||
`${uniqueCode} RESPONSE load balance validate: ${JSON.stringify(
|
||||
result
|
||||
)}`
|
||||
);
|
||||
} else {
|
||||
result = {
|
||||
code: '434',
|
||||
message: '[434] Failed, please try again later',
|
||||
data: {
|
||||
amount: amountTopup,
|
||||
total_reservation: totalReservation,
|
||||
reservation_number: reservationNumber,
|
||||
},
|
||||
};
|
||||
|
||||
// log info
|
||||
winston.logger.info(
|
||||
`${uniqueCode} RESPONSE load balance validate: ${JSON.stringify(
|
||||
result
|
||||
)}`
|
||||
);
|
||||
}
|
||||
|
||||
return res.json(result);
|
||||
} catch (error) {
|
||||
// create log
|
||||
|
||||
Reference in New Issue
Block a user