Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. пишет что notificationService.getNotificationSettings  это не функция
  2.  
  3. Router
  4. ------------------------------
  5.  
  6. router.get("/settings",JWTMiddleware, function (req, res, next){
  7.     res.setHeader("Content-Type", "application/json");
  8.     notificationService.getNotificationSettings(req.userId).then(            <---------------- ошибка здесь
  9.         model => {
  10.             req.data = model;
  11.             next();
  12.         },
  13.         error => {
  14.             req.data.success = false;
  15.             req.data.info = error;
  16.             next();
  17.         });
  18. });
  19.  
  20.  
  21. Service
  22. ------------------------------
  23.  
  24. const getNotificationSettings = async (userId) => {
  25.     return notificationSettingsModel.findAll(
  26.     {
  27.         where:{id:userId}
  28.     }).then(model => {return model;}).catch(error => {throw error});
  29. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement