--- a/controllers/controllerV0.js
+++ b/controllers/controllerV0.js
@@ -54,13 +54,17 @@
if(isOK) {
controllerNotification.notificationHandler(req.body.body, req.body.token, function(ifOK, reason, notificationsCreated){
if(isOK) {
- //execute email based on the reason
- controllerNotification.cronDispatcher(reason);
- //execute http request based on the reason
- controllerNotification.cronDispatcherHTTPRequest(reason);
- //execute smart system for rules creation
- smartSystem.smartRulesHandler();
- sendResponse(200, {success: true, reason:reason},"Notification: Successfully", res);
+ if(reason.includes("There is no Rules for this vApp :")){
+ sendResponse(404, {success: true, reason:reason},"Notification: " + reason, res);
+ }else{
+ //execute smart system for rules creation
+ smartSystem.smartRulesHandler();
+ //execute email based on the reason
+ controllerNotification.cronDispatcher(reason);
+ //execute http request based on the reason
+ controllerNotification.cronDispatcherHTTPRequest(reason);
+ sendResponse(200, {success: true, reason:reason},"Notification: Successfully", res);
+ }
}else {
sendResponse(500, {success: false, reason: reason},"Notification: "+reason, res);
}