Answer the question
In order to leave comments, you need to log in
How to sequentially execute a query?
var menuOtd = [];
pnd.findOne({where:{id: request.body.dataPnd}})
.then(pnds=>{
if(!pnds) return;
pnds.getOtds().then(otds=>{
for(ot of otds){
if(ot.pndOtd.sub == "true"){
}else{
menuOtd.push(ot.name);
};
};
})
.finally(console.log(menuOtd));
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question