Skip to content

Commit 5f84a8b

Browse files
authored
fix: Include option in getObject feature is not working (#814)
1 parent 7dd2626 commit 5f84a8b

File tree

5 files changed

+15
-9
lines changed

5 files changed

+15
-9
lines changed

packages/dart/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [3.1.9](https://github.com/parse-community/Parse-SDK-Flutter/compare/dart-3.1.8...dart-3.1.9) (2022-12-25)
2+
3+
### Features
4+
5+
* Include option in `getObject` feature is not working ([#813](https://github.com/parse-community/Parse-SDK-Flutter/issues/813))
6+
17
## [3.1.8](https://github.com/parse-community/Parse-SDK-Flutter/compare/dart-3.1.7...dart-3.1.8) (2022-12-23)
28

39
### Features

packages/dart/lib/src/base/parse_constants.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
part of flutter_parse_sdk;
22

33
// Library
4-
const String keySdkVersion = '3.1.8';
4+
const String keySdkVersion = '3.1.9';
55
const String keyLibraryName = 'Flutter Parse SDK';
66

77
// End Points

packages/dart/lib/src/objects/parse_object.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,13 @@ class ParseObject extends ParseBase implements ParseCloneable {
3838
Future<ParseResponse> getObject(String objectId,
3939
{List<String>? include}) async {
4040
try {
41-
String uri = '$_path/$objectId';
41+
String? query;
4242
if (include != null) {
43-
uri = '$uri?include=${concatenateArray(include)}';
43+
query = 'include=${concatenateArray(include)}';
4444
}
45-
final Uri url = getSanitisedUri(_client, uri);
45+
46+
final Uri url =
47+
getSanitisedUri(_client, '$_path/$objectId', query: query);
4648

4749
final ParseNetworkResponse result = await _client.get(url.toString());
4850
return handleResponse<ParseObject>(

packages/dart/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: parse_server_sdk
22
description: Dart plugin for Parse Server, (https://parseplatform.org), (https://back4app.com)
3-
version: 3.1.8
3+
version: 3.1.9
44
homepage: https://github.com/parse-community/Parse-SDK-Flutter
55

66
environment:

packages/dart/test/parse_object_test.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ void main() {
9898
objectJsonDesiredOutput);
9999
expect(parseObject['img'].objectId, "8nGrLj3Mvk");
100100

101-
expect(Uri.decodeComponent(result.path),
102-
'/classes/MyUser/Mn1iJTkWTE?include=img');
101+
expect(Uri.decodeComponent(result.query), 'include=img');
103102
});
104103

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

181-
expect(Uri.decodeComponent(result.path),
182-
'/classes/MyUser/Mn1iJTkWTE?include=img');
180+
expect(Uri.decodeComponent(result.query), 'include=img');
183181
});
184182
});
185183
}

0 commit comments

Comments
 (0)