Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- пишет что notificationService.getNotificationSettings это не функция
- Router
- ------------------------------
- router.get("/settings",JWTMiddleware, function (req, res, next){
- res.setHeader("Content-Type", "application/json");
- notificationService.getNotificationSettings(req.userId).then( <---------------- ошибка здесь
- model => {
- req.data = model;
- next();
- },
- error => {
- req.data.success = false;
- req.data.info = error;
- next();
- });
- });
- Service
- ------------------------------
- const getNotificationSettings = async (userId) => {
- return notificationSettingsModel.findAll(
- {
- where:{id:userId}
- }).then(model => {return model;}).catch(error => {throw error});
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement