Refactoring + Version améliorée
This commit is contained in:
@@ -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'},
|
||||
);
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user