Skip to content
This repository has been archived by the owner on Jul 6, 2024. It is now read-only.

Commit

Permalink
Fix datetime for getEvents request (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierPaquet-Rapold authored Jun 5, 2024
1 parent 8f7c94d commit e641cbb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 19 deletions.
30 changes: 12 additions & 18 deletions lib/src/hello_api_client_implementation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit e641cbb

Please sign in to comment.