diff --git a/www-api/app/Config/Routes.php b/www-api/app/Config/Routes.php index ba6539a2..3d86f2b2 100644 --- a/www-api/app/Config/Routes.php +++ b/www-api/app/Config/Routes.php @@ -44,6 +44,8 @@ $routes->get('/en/flow/api/v1/due-reminder', 'AirFlow::flowDueReminder'); $routes->get('/en/flow/api/v1/approve-reminder','AirFlow::flowApproveReminder'); $routes->get('/en/flow/api/v1/signup-report', 'AirFlow::flowSignupReport'); $routes->get('/en/flow/api/v1/refresh-blog', 'AirFlow::flowRefreshBlog'); +$routes->get('/en/flow/api/v1/notifications', 'AirFlow::flowSendNotifications'); + include "RoutesV1.php"; diff --git a/www-api/app/Controllers/AirFlow.php b/www-api/app/Controllers/AirFlow.php index fbee3758..a7084c68 100644 --- a/www-api/app/Controllers/AirFlow.php +++ b/www-api/app/Controllers/AirFlow.php @@ -41,7 +41,7 @@ class AirFlow extends BaseController $out =[]; log_message('critical', "AirFlow::flowDueReminder ********* ALL ".serialize($in) ); return $this->jobLevelAlerts(); - + // return []; //json_encode( $final_out ); } @@ -54,6 +54,21 @@ class AirFlow extends BaseController return []; //json_encode( $final_out ); } + public function flowSendNotifications(){ + + $raw_json = file_get_contents('php://input'); + $in = json_decode($raw_json, true); + $out =[]; + log_message('critical', "AirFlow::flowApproveReminder ********* ALL ".serialize($in) ); + $in["loc"] = $_SERVER["REMOTE_ADDR"]; + $in['call_action'] = WRB_CRONJOB_NOTIFICATIONS; + $in['one_limit'] = 10; //remove this + $in['limit'] = 10; + $ret['WRB_CRONJOB_NOTIFICATIONS'] = (new \App\Models\BackendModel())->wrenchboard_api($in, $out); + return []; //json_encode( $final_out ); + } + + public function flowSignupReport(){ $raw_json = file_get_contents('php://input'); diff --git a/www-api/app/Controllers/WrenchNotifications.php b/www-api/app/Controllers/WrenchNotifications.php index 26ba2db7..41833028 100644 --- a/www-api/app/Controllers/WrenchNotifications.php +++ b/www-api/app/Controllers/WrenchNotifications.php @@ -102,6 +102,7 @@ class WrenchNotifications extends BaseController return $this->response->setJson($response); } + private function dummyData(){ //define('WRENCHBOARD_ACCT_NOTIFICATIONS', 11046); $ic =['alert.svg','message.svg','phone.svg','sms.svg'];