Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let arr_link = new Promise(function(resolve,reject){
- let link = [];
- for(lefts of lef){
- models.db.l_d.findOne({where: {id: lefts.l_d.id}})
- .then(ld=>{
- ld.getMains()
- .then(ma=>{
- for(m of ma){
- let arr_data = {
- data: data.name,
- dataId: data.Id,
- left: lefts.name,
- leftId: lefts.id,
- main: m.name,
- mainId: m.id,
- linkId: m.ld_m.id
- };
- link.push(arr_data);
- }
- })
- .catch(err=>console.log(err));
- })
- .catch(err=>console.log(err));
- }
- resolve();
- });
- arr_link.then(function(result){
- console.log(result);
- });
Advertisement
Add Comment
Please, Sign In to add comment