Skip to content

Commit 6d04bee

Browse files
committed
Fixed ParseObject create
1 parent 701ec0a commit 6d04bee

File tree

7 files changed

+15
-5
lines changed

7 files changed

+15
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
## 1.0.19
2+
13
## 1.0.18
4+
Bug fixes
25

36
## 1.0.17
47
LiveQuery fix

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Want to get involved? Join our Slack channel and help out! (http://flutter-parse
1313
To install, either add to your pubspec.yaml
1414
```yml
1515
dependencies:
16-
parse_server_sdk: ^1.0.18
16+
parse_server_sdk: ^1.0.19
1717
```
1818
or clone this repository and add to your project. As this is an early development with multiple contributors, it is probably best to download/clone and keep updating as an when a new feature is added.
1919

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 = '1.0.18';
4+
const String keySdkVersion = '1.0.19';
55
const String keyLibraryName = 'Flutter Parse SDK';
66

77
// End Points

lib/src/network/parse_live_query.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class LiveQuery {
9898
if (_debug) {
9999
print('$_printConstLiveQuery: Done');
100100
}
101-
}, onError: (error) {
101+
}, onError: (Error error) {
102102
if (_debug) {
103103
print(
104104
'$_printConstLiveQuery: Error: ${error.runtimeType.toString()}');

lib/src/objects/parse_object.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class ParseObject extends ParseBase implements ParseCloneable {
6565
Future<ParseResponse> create() async {
6666
try {
6767
final Uri url = getSanitisedUri(_client, '$_path');
68-
final String body = json.encode(toJson(forApiRQ: true));
68+
final String body = json.encode(toJson());
6969
final Response result = await _client.post(url, body: body);
7070

7171
//Set the objectId on the object after it is created.

lib/src/objects/response/parse_response_builder.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ class _ParseResponseBuilder {
1717

1818
if (isUnsuccessfulResponse(apiResponse)) {
1919
return buildErrorResponse(parseResponse, apiResponse);
20+
} else if (isHealthCheck(apiResponse)) {
21+
parseResponse.success = true;
22+
return parseResponse;
2023
} else if (isSuccessButNoResults(apiResponse)) {
2124
return buildSuccessResponseWithNoResults(
2225
parseResponse, 1, 'Successful request, but no results found');
@@ -108,4 +111,8 @@ class _ParseResponseBuilder {
108111
return null;
109112
}
110113
}
114+
115+
bool isHealthCheck(Response apiResponse) {
116+
return apiResponse.body == "{\"status\":\"ok\"}";
117+
}
111118
}

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: Flutter plugin for Parse Server, (https://parseplatform.org), (https://back4app.com)
3-
version: 1.0.18
3+
version: 1.0.19
44
homepage: https://github.com/phillwiggins/flutter_parse_sdk
55
author: PhillWiggins <[email protected]>
66

0 commit comments

Comments
 (0)