Disable /worker/test endpoint and update Slack notification method in workerRoute.php
This commit is contained in:
@@ -40,12 +40,13 @@ class workerRoute
|
||||
$this->get('/worker/test', function () {
|
||||
global /** @var router $router */
|
||||
$response, $router;
|
||||
$response->error('This endpoint is disabled for security reasons.', 403);
|
||||
$department = (new departments_o())->select((int)6);
|
||||
$days = 7;
|
||||
// The time should be from 00:00:00 of the start date to 23:59:59 of the end date
|
||||
$date_end = date('Y-m-d 23:59:59'); // Today at 23:59:59
|
||||
$date_start = date('Y-m-d 00:00:00', strtotime("-$days days")); // $days ago at 00:00:00
|
||||
$department->sendPeriodStatisticsToSlack($date_start, $date_end);
|
||||
$department->sendSlackInternalStatisticNotification($date_start, $date_end, [1,2,3,4,5,6,7]);
|
||||
$response->success(['message' => 'Test message sent to Slack (not really, this is a placeholder).' ]);
|
||||
exit;
|
||||
// Configuration
|
||||
|
||||
Reference in New Issue
Block a user