Refactoring + Version améliorée

This commit is contained in:
DahoudG
2024-09-25 21:28:04 +00:00
parent 6b12cfeb41
commit 8e625c1080
28 changed files with 1113 additions and 261 deletions

View File

@@ -174,7 +174,7 @@ class EventRemoteDataSource {
print('Réouverture de l\'événement avec l\'ID: $eventId');
final response = await client.post(
Uri.parse('${Urls.baseUrl}/$eventId/reopen'),
Uri.parse('${Urls.reopenEvent}/$eventId/reopen'),
headers: {'Content-Type': 'application/json'},
);

View File

@@ -7,7 +7,7 @@ class EventModel {
final String category;
final String link;
final String? imageUrl; // Nullable
final String creatorEmail; // Remplacer UserModel si le créateur est un email
final String creatorEmail;
final List<dynamic> participants; // Si participants est une liste simple
final String status;
final int reactionsCount;
@@ -43,7 +43,7 @@ class EventModel {
imageUrl: json['imageUrl'], // Peut être null
creatorEmail: json['creatorEmail'], // Email du créateur
participants: json['participants'] ?? [], // Gérer les participants
status: json['status'] ?? 'open', // Par défaut à "open" si non fourni
status: json['status'] ?? 'ouvert', // Par défaut à "ouvert" si non fourni
reactionsCount: json['reactionsCount'] ?? 0,
commentsCount: json['commentsCount'] ?? 0,
sharesCount: json['sharesCount'] ?? 0,