diff --git a/lib/bloc/forecast/forecast_bloc.dart b/lib/bloc/forecast/forecast_bloc.dart index f1f40a54..5186ecc5 100644 --- a/lib/bloc/forecast/forecast_bloc.dart +++ b/lib/bloc/forecast/forecast_bloc.dart @@ -68,7 +68,7 @@ class ForecastBloc extends Bloc { final body = json.decode(response.body); return (body['records'] as List).map((json) { - if (json['fields']['bateau'].toString().toLowerCase() == + if (json['fields']['bateaux'].toString().toLowerCase() == 'maintenance') { final maintenanceForecast = MaintenanceForecast.fromJSON(json); diff --git a/lib/models/boat_forecast.dart b/lib/models/boat_forecast.dart index 5ebb7bb6..327bf2e5 100644 --- a/lib/models/boat_forecast.dart +++ b/lib/models/boat_forecast.dart @@ -61,7 +61,7 @@ class BoatForecast extends AbstractForecast { List boats = []; bool isLeaving = false; - final rawBoatName = json['fields']['bateau'] as String; + final rawBoatName = json['fields']['bateaux'] as String; final boatNames = rawBoatName.split(RegExp(r'/')); for (final boatName in boatNames) { final trimmedBoatName = boatName.trim(); diff --git a/test/units/boat_forecast_test.dart b/test/units/boat_forecast_test.dart index f2ada957..0348f6dc 100644 --- a/test/units/boat_forecast_test.dart +++ b/test/units/boat_forecast_test.dart @@ -49,7 +49,7 @@ void main() { 'recordid': '82c316d304b1adef7eeef9edc9ab7b257f766086', 'fields': { 'fermeture_totale': 'oui', - 'bateau': 'MARITE', + 'bateaux': 'MARITE', 'date_passage': '2023-03-02', 're_ouverture_a_la_circulation': '16:49', 'fermeture_a_la_circulation': '15:49', @@ -62,7 +62,7 @@ void main() { 'recordid': '82c316d304b1adef7eeef9edc9ab7b257f766086', 'fields': { 'fermeture_totale': 'oui', - 'bateau': 'MARITE', + 'bateaux': 'MARITE', 'date_passage': '2023-03-15', 're_ouverture_a_la_circulation': '16:49', 'fermeture_a_la_circulation': '15:49',