Skip to content

Commit

Permalink
fix: Include option in getObject feature is not working (#814)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbfakourii authored Dec 24, 2022
1 parent 7dd2626 commit 5f84a8b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
6 changes: 6 additions & 0 deletions packages/dart/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [3.1.9](https://github.com/parse-community/Parse-SDK-Flutter/compare/dart-3.1.8...dart-3.1.9) (2022-12-25)

### Features

* Include option in `getObject` feature is not working ([#813](https://github.com/parse-community/Parse-SDK-Flutter/issues/813))

## [3.1.8](https://github.com/parse-community/Parse-SDK-Flutter/compare/dart-3.1.7...dart-3.1.8) (2022-12-23)

### Features
Expand Down
2 changes: 1 addition & 1 deletion packages/dart/lib/src/base/parse_constants.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
part of flutter_parse_sdk;

// Library
const String keySdkVersion = '3.1.8';
const String keySdkVersion = '3.1.9';
const String keyLibraryName = 'Flutter Parse SDK';

// End Points
Expand Down
8 changes: 5 additions & 3 deletions packages/dart/lib/src/objects/parse_object.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ class ParseObject extends ParseBase implements ParseCloneable {
Future<ParseResponse> getObject(String objectId,
{List<String>? include}) async {
try {
String uri = '$_path/$objectId';
String? query;
if (include != null) {
uri = '$uri?include=${concatenateArray(include)}';
query = 'include=${concatenateArray(include)}';
}
final Uri url = getSanitisedUri(_client, uri);

final Uri url =
getSanitisedUri(_client, '$_path/$objectId', query: query);

final ParseNetworkResponse result = await _client.get(url.toString());
return handleResponse<ParseObject>(
Expand Down
2 changes: 1 addition & 1 deletion packages/dart/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: parse_server_sdk
description: Dart plugin for Parse Server, (https://parseplatform.org), (https://back4app.com)
version: 3.1.8
version: 3.1.9
homepage: https://github.com/parse-community/Parse-SDK-Flutter

environment:
Expand Down
6 changes: 2 additions & 4 deletions packages/dart/test/parse_object_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ void main() {
objectJsonDesiredOutput);
expect(parseObject['img'].objectId, "8nGrLj3Mvk");

expect(Uri.decodeComponent(result.path),
'/classes/MyUser/Mn1iJTkWTE?include=img');
expect(Uri.decodeComponent(result.query), 'include=img');
});

test('should return expectedIncludeResult json when use getObject',
Expand Down Expand Up @@ -178,8 +177,7 @@ void main() {
objectJsonDesiredOutput);
expect(parseObject['img'].objectId, "8nGrLj3Mvk");

expect(Uri.decodeComponent(result.path),
'/classes/MyUser/Mn1iJTkWTE?include=img');
expect(Uri.decodeComponent(result.query), 'include=img');
});
});
}

0 comments on commit 5f84a8b

Please sign in to comment.