Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. Customer.update({
  2. cid: req.body.cid,
  3. pass: req.body.pass,
  4. name: req.body.name,
  5. address: req.body.address,
  6. cnic: req.body.cnic,
  7. mobile: req.body.mobile,
  8. packageid: req.body.packageid,
  9. status: req.body.status,
  10. active_dt: req.body.active_dt,
  11. exp_dt: req.body.exp_dt,
  12. payment: req.body.payment,
  13. bal: req.body.bal
  14. },
  15. {
  16. where: {
  17. id: req.params.id
  18. }
  19. }).then(Custom => {
  20. Package.findAll({
  21. where: {
  22. pname: {
  23. [Op.or]: req.body.packname
  24. }
  25. }
  26. }).then(packname => {
  27. Custom.setPackageRef(packname).then(() => {
  28. res.send({ message: 'Update successfully!' });
  29. });
  30. }).catch(err => {
  31. res.status(500).send({ reason: err.message });
  32. });
  33. }).catch(err => {
  34. res.status(500).send({ reason: err.message });
  35. })
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement