schema fix

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
Sven laptop
2026-05-05 19:55:51 +02:00
parent c847d32743
commit 8d4e8b3075
7 changed files with 99 additions and 44 deletions
@@ -6,7 +6,8 @@ import 'auth_service.dart';
/// Schedule/Route Service
class ScheduleService {
// TODO: Implement API connector - configure base URL from env/config
static const String _apiBaseUrl = 'http://localhost:5000';
// Transit API runs on port 5001
static const String _apiBaseUrl = 'http://192.168.2.66:5001';
final _authService = AuthService();
/// Get daily schedule for a specific date
@@ -43,8 +44,9 @@ class ScheduleService {
try {
final headers = await _authService.getAuthHeaders();
// Transit API exposes route details at /routes/:routeId
final response = await http.get(
Uri.parse('$_apiBaseUrl/schedule/route/$routeId'),
Uri.parse('$_apiBaseUrl/routes/$routeId'),
headers: headers,
);
@@ -66,8 +68,9 @@ class ScheduleService {
try {
final headers = await _authService.getAuthHeaders();
// Transit API updates status at /routes/:routeId/status
final response = await http.patch(
Uri.parse('$_apiBaseUrl/schedule/route/$routeId/status'),
Uri.parse('$_apiBaseUrl/routes/$routeId/status'),
headers: headers,
body: jsonEncode({'status': status}),
);