change endpoint & type

This commit is contained in:
Thies Mueller 2025-06-17 16:19:27 +02:00
parent ef32cd3583
commit 7de35eceb9
No known key found for this signature in database
GPG Key ID: 8F7CEF80016CA403

View File

@ -9,7 +9,7 @@ function fetch_api($url) {
return $json ? json_decode($json, true) : []; return $json ? json_decode($json, true) : [];
} }
$messages = fetch_api("https://api.sat.regattatech.de/api/v1/messages"); $messages = fetch_api("https://api.sat.regattatech.de/api/v1/message");
$resultsData = fetch_api("https://api.sat.regattatech.de/api/v1/results/current/"); $resultsData = fetch_api("https://api.sat.regattatech.de/api/v1/results/current/");
$rennplanData = fetch_api("https://api.sat.regattatech.de/api/v1/rennplan/current/"); $rennplanData = fetch_api("https://api.sat.regattatech.de/api/v1/rennplan/current/");
@ -31,7 +31,7 @@ function render_message_box($message) {
$typeMap = [ $typeMap = [
'info' => 'success', 'info' => 'success',
'warning' => 'warning', 'warning' => 'warning',
'danger' => 'danger' 'error' => 'danger'
]; ];
$type = $typeMap[$message['type']] ?? 'secondary'; $type = $typeMap[$message['type']] ?? 'secondary';
return "<div class='alert alert-{$type} fs-5' role='alert'>{$message['message']}</div>"; return "<div class='alert alert-{$type} fs-5' role='alert'>{$message['message']}</div>";