diff --git a/lib/src/hello_api_client_implementation.dart b/lib/src/hello_api_client_implementation.dart index b929fc9..7228122 100644 --- a/lib/src/hello_api_client_implementation.dart +++ b/lib/src/hello_api_client_implementation.dart @@ -49,33 +49,27 @@ class HelloAPIClient implements IHelloAPIClient { throw ArgumentError("_apiLink is null or empty"); } final query = { - 'startDate': startDate, - 'endDate': endDate, - 'tags': tags, - 'activityAreas': activityAreas, - 'organizerId': organizerId, - 'title': title, 'pageNumber': pageNumber.toString(), 'pageSize': pageSize.toString(), }; - if (query['startDate'] == null) { - query.remove('startDate'); + if (startDate != null) { + query['startDate'] = startDate.toUtc().toIso8601String(); } - if (query['endDate'] == null) { - query.remove('endDate'); + if (endDate != null) { + query['endDate'] = endDate.toUtc().toIso8601String(); } - if (query['tags'] == null) { - query.remove('tags'); + if (tags != null) { + query['tags'] = tags.toString(); } - if (query['activityAreas'] == null) { - query.remove('activityAreas'); + if (activityAreas != null) { + query['activityAreas'] = activityAreas.toString(); } - if (query['organizerId'] == null) { - query.remove('organizerId'); + if (organizerId != null) { + query['organizerId'] = organizerId; } - if (query['title'] == null) { - query.remove('title'); + if (title != null) { + query['title'] = title; } final uri = Uri.https(apiLink!, '/api/events'); diff --git a/pubspec.yaml b/pubspec.yaml index 1b8bbe9..8e2e020 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: ets_api_clients description: API clients to help process calls from any application that need to access -version: 1.2.5 +version: 1.2.6 homepage: https://clubapplets.ca/ repository: https://github.com/ApplETS/ETS-API-Clients