date_format_convertion:GWm
This commit is contained in:
parent
56a0cfc9c7
commit
ee798c66f2
@ -29,8 +29,19 @@ exports.PullCreditPdData = async (req, res) => {
|
|||||||
obj = {};
|
obj = {};
|
||||||
GenInfoObj = {};
|
GenInfoObj = {};
|
||||||
temp_array = [];
|
temp_array = [];
|
||||||
|
|
||||||
|
if(req.body.completed_date === null){ completed_date = req.body.completed_date }else{
|
||||||
|
originalDate = req.body.completed_date;
|
||||||
|
parts = originalDate.split(/[/ :]/);
|
||||||
|
day = parts[0];
|
||||||
|
month = parts[1];
|
||||||
|
year = parts[2];
|
||||||
|
completed_date = `${year}-${month}-${day}`;
|
||||||
|
}
|
||||||
|
console.log(completed_date);
|
||||||
// create creditGeneralInormationData
|
// create creditGeneralInormationData
|
||||||
Object.assign(obj, { ref_no: tempData.pdid , product : tempData.product , case_no : tempData.caseno , credit_pd_type : req.body.credit_pd_type , completed_date : req.body.completed_date});
|
Object.assign(obj, { ref_no: tempData.pdid , product : tempData.product , case_no : tempData.caseno , credit_pd_type : req.body.credit_pd_type , completed_date : completed_date});
|
||||||
|
|
||||||
await CreditGeneralInformation.create(obj)
|
await CreditGeneralInformation.create(obj)
|
||||||
.then((successData)=>{logMsg.info("GeneralInformation insert success ,PdId= "+successData.dataValues.pd_id);})
|
.then((successData)=>{logMsg.info("GeneralInformation insert success ,PdId= "+successData.dataValues.pd_id);})
|
||||||
.catch((err)=>{ logMsg.info("GeneralInformation insert failed ,PdId(ref_no)= "+req.body.pdid+ " ERR =" + err); });
|
.catch((err)=>{ logMsg.info("GeneralInformation insert failed ,PdId(ref_no)= "+req.body.pdid+ " ERR =" + err); });
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user