In my Sails project, I have a User model / controller and a Request model / controller, as well as a Dashboard controller. The user can request data using RequestController.create , and the administrator can approve it using RequestController.grant .
I want to do this to notify the user when one of his / her requests is approved (updated). In RequestController.grant I call Request.publishUpdate(...) , and in my DashboardController.display I call
Request.find(req.session.user.id, function(err, requests) { ... Request.subscribe(req, requests, ['update']) ... });
Then, in the /dashboard/display view, I put the <script> tags:
<script> </script>
However, after approving the user request and switching to the control panel, an alert does not appear. The script for sails.io is already loaded, without errors in the console. Am I doing something wrong?
source share