File tree Expand file tree Collapse file tree 4 files changed +32
-4
lines changed Expand file tree Collapse file tree 4 files changed +32
-4
lines changed Original file line number Diff line number Diff line change
1
+ ## [ 3.1.15] ( https://github.com/parse-community/Parse-SDK-Flutter/compare/dart-3.1.14...dart-3.1.15 ) (2023-02-28)
2
+
3
+ ### Bug Fixes
4
+
5
+ * Updating and deleting a ParseObject sends requests even if object ID is null ([ #829 ] ( https://github.com/parse-community/Parse-SDK-Flutter/pull/829 ) )
6
+
1
7
## [ 3.1.14] ( https://github.com/parse-community/Parse-SDK-Flutter/compare/dart-3.1.13...dart-3.1.14 ) (2023-02-26)
2
8
3
9
### Bug Fixes
Original file line number Diff line number Diff line change 1
1
part of flutter_parse_sdk;
2
2
3
3
// Library
4
- const String keySdkVersion = '3.1.14 ' ;
4
+ const String keySdkVersion = '3.1.15 ' ;
5
5
const String keyLibraryName = 'Flutter Parse SDK' ;
6
6
7
7
// End Points
Original file line number Diff line number Diff line change @@ -86,6 +86,11 @@ class ParseObject extends ParseBase implements ParseCloneable {
86
86
}
87
87
88
88
Future <ParseResponse > update () async {
89
+ assert (
90
+ objectId != null && (objectId? .isNotEmpty ?? false ),
91
+ "Can't update a parse object while the objectId property is null or empty" ,
92
+ );
93
+
89
94
try {
90
95
final Uri url = getSanitisedUri (_client, '$_path /$objectId ' );
91
96
final String body = json.encode (toJson (forApiRQ: true ));
@@ -443,8 +448,25 @@ class ParseObject extends ParseBase implements ParseCloneable {
443
448
}
444
449
445
450
/// Deletes the current object locally and online
446
- Future <ParseResponse > delete <T extends ParseObject >(
447
- {String ? id, String ? path}) async {
451
+ Future <ParseResponse > delete <T extends ParseObject >({
452
+ String ? id,
453
+ String ? path,
454
+ }) async {
455
+ assert (() {
456
+ final objId = objectId;
457
+ final isNotValidObjectId = objId == null || objId.isEmpty;
458
+ final isNotValidIdArg = id == null || id.isEmpty;
459
+
460
+ if (isNotValidObjectId && isNotValidIdArg) {
461
+ throw Exception (
462
+ "Can't delete a parse object while the objectId property "
463
+ "and id argument is null or empty" ,
464
+ );
465
+ }
466
+
467
+ return true ;
468
+ }());
469
+
448
470
try {
449
471
path ?? = _path;
450
472
id ?? = objectId;
Original file line number Diff line number Diff line change 1
1
name : parse_server_sdk
2
2
description : Dart plugin for Parse Server, (https://parseplatform.org), (https://back4app.com)
3
- version : 3.1.14
3
+ version : 3.1.15
4
4
homepage : https://github.com/parse-community/Parse-SDK-Flutter
5
5
6
6
environment :
You can’t perform that action at this time.
0 commit comments