fix: allow guests to view event details by passing pre-loaded data

LearnMoreScreen now accepts an optional initialEvent parameter so it
can render immediately from already-loaded data instead of re-fetching
from the event-details API. This fixes the guest-mode flow where the
unauthenticated API call was failing. Also changed getEventDetails to
requiresAuth: true so logged-in users send their token when the API
path is used.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-29 19:25:40 +05:30
parent 1e90f5fc4b
commit c32f343558
6 changed files with 26 additions and 19 deletions

View File

@@ -40,7 +40,7 @@ class EventsService {
/// Event details
Future<EventModel> getEventDetails(int eventId) async {
final res = await _api.post(ApiEndpoints.eventDetails, body: {'event_id': eventId}, requiresAuth: false);
final res = await _api.post(ApiEndpoints.eventDetails, body: {'event_id': eventId}, requiresAuth: true);
return EventModel.fromJson(Map<String, dynamic>.from(res));
}