Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- main.belongsToMany(left,{through: m_l});
- left.belongsToMany(main,{through: m_l});
- data.belongsToMany(left,{through: l_d});
- left.belongsToMany(data,{through: l_d});
- l_d.belongsToMany(main,{through: ld_m});
- main.belongsToMany(l_d,{through: ld_m});
- -------------------------------
- router.post('/create-link-ldm',(request,response)=>{
- models.db.main.findOne({
- where:{id: request.body.main}
- })
- .then(main=>{
- models.db.l_d.findOne({
- where: {id: request.body.ld}
- })
- .then(ld=>{
- main.addLd(ld);
- response.json({
- add: true
- });
- })
- .catch(err=>console.log(err));
- })
- .catch(err=>console.log(err));
- });
Advertisement
Add Comment
Please, Sign In to add comment