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+
17## [ 3.1.14] ( https://github.com/parse-community/Parse-SDK-Flutter/compare/dart-3.1.13...dart-3.1.14 ) (2023-02-26)
28
39### Bug Fixes
Original file line number Diff line number Diff line change 11part of flutter_parse_sdk;
22
33// Library
4- const String keySdkVersion = '3.1.14 ' ;
4+ const String keySdkVersion = '3.1.15 ' ;
55const String keyLibraryName = 'Flutter Parse SDK' ;
66
77// End Points
Original file line number Diff line number Diff line change @@ -86,6 +86,11 @@ class ParseObject extends ParseBase implements ParseCloneable {
8686 }
8787
8888 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+
8994 try {
9095 final Uri url = getSanitisedUri (_client, '$_path /$objectId ' );
9196 final String body = json.encode (toJson (forApiRQ: true ));
@@ -443,8 +448,25 @@ class ParseObject extends ParseBase implements ParseCloneable {
443448 }
444449
445450 /// 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+
448470 try {
449471 path ?? = _path;
450472 id ?? = objectId;
Original file line number Diff line number Diff line change 11name : parse_server_sdk
22description : Dart plugin for Parse Server, (https://parseplatform.org), (https://back4app.com)
3- version : 3.1.14
3+ version : 3.1.15
44homepage : https://github.com/parse-community/Parse-SDK-Flutter
55
66environment :
You can’t perform that action at this time.
0 commit comments