feat: Version 3.6.2 - Correctifs tâches #17-20
- #17: Amélioration gestion des secteurs et statistiques - #18: Optimisation services API et logs - #19: Corrections Flutter widgets et repositories - #20: Fix création passage - détection automatique ope_users.id vs users.id Suppression dossier web/ (migration vers app Flutter) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -247,10 +247,10 @@ class OperationRepository extends ChangeNotifier {
|
||||
debugPrint('✅ Opérations traitées');
|
||||
}
|
||||
|
||||
// Traiter les secteurs (groupe secteurs) via DataLoadingService
|
||||
if (responseData['secteurs'] != null) {
|
||||
// Traiter les secteurs (groupe sectors) via DataLoadingService
|
||||
if (responseData['sectors'] != null) {
|
||||
await DataLoadingService.instance
|
||||
.processSectorsFromApi(responseData['secteurs']);
|
||||
.processSectorsFromApi(responseData['sectors']);
|
||||
debugPrint('✅ Secteurs traités');
|
||||
}
|
||||
|
||||
@@ -521,10 +521,10 @@ class OperationRepository extends ChangeNotifier {
|
||||
debugPrint('✅ Opérations traitées');
|
||||
}
|
||||
|
||||
// Traiter les secteurs (groupe secteurs) via DataLoadingService
|
||||
if (responseData['secteurs'] != null) {
|
||||
// Traiter les secteurs (groupe sectors) via DataLoadingService
|
||||
if (responseData['sectors'] != null) {
|
||||
await DataLoadingService.instance
|
||||
.processSectorsFromApi(responseData['secteurs']);
|
||||
.processSectorsFromApi(responseData['sectors']);
|
||||
debugPrint('✅ Secteurs traités');
|
||||
}
|
||||
|
||||
|
||||
@@ -246,8 +246,9 @@ class PassageRepository extends ChangeNotifier {
|
||||
|
||||
// Mode online : traitement normal
|
||||
if (response.statusCode == 201 || response.statusCode == 200) {
|
||||
// Récupérer l'ID du nouveau passage depuis la réponse
|
||||
final passageId = response.data['id'] is String ? int.parse(response.data['id']) : response.data['id'] as int;
|
||||
// Récupérer l'ID du nouveau passage depuis la réponse (passage_id ou id)
|
||||
final rawId = response.data['passage_id'] ?? response.data['id'];
|
||||
final passageId = rawId is String ? int.parse(rawId) : rawId as int;
|
||||
|
||||
// Créer le passage localement avec l'ID retourné par l'API
|
||||
final newPassage = passage.copyWith(
|
||||
@@ -431,10 +432,10 @@ class PassageRepository extends ChangeNotifier {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
throw Exception('Mise à jour refusée par le serveur');
|
||||
} catch (e) {
|
||||
debugPrint('Erreur lors de la mise à jour du passage: $e');
|
||||
return false;
|
||||
rethrow; // Propager l'exception originale avec son message
|
||||
} finally {
|
||||
_isLoading = false;
|
||||
notifyListeners();
|
||||
|
||||
Reference in New Issue
Block a user