I'm trying to call a function after a function finish work
invalue.map((val) => {
const data = column.map(v=>{ return encryptData.regularDataEncrypt( val[v])});
const withcote = data.map(x => {return "'" + x + "'"})
const serialnumber_voice =val.serialnumber_voice;
const cassdataQuery=`insert into cdr_voice(id,${str},isencrypted) values(now(),${withcote.join()},false)`;
db.execute(cassdataQuery).then(data=>{
pg.query(`update cdr_voice set is_cassandra= true WHERE serialnumber_voice = ${serialnumber_voice}`).then(u=>{
console.log("is_cassandra updated",serialnumber_voice )
})
console.log("data updated ",serialnumber_voice)
})
})
I went to execute
function incrementQueryValue(){
encryptCdrVoice()
}
function after the map function done