Disable /worker/test endpoint and update Slack notification method in workerRoute.php

This commit is contained in:
Jeppe Bundgaard
2026-01-22 08:58:52 +01:00
parent 16703f5938
commit 127be6ece7
+2 -1
View File
@@ -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