diff --git a/lib/src/objects/parse_object.dart b/lib/src/objects/parse_object.dart index d39757582..0695417c9 100644 --- a/lib/src/objects/parse_object.dart +++ b/lib/src/objects/parse_object.dart @@ -164,12 +164,16 @@ class ParseObject extends ParseBase implements ParseCloneable { /// Can be used to add arrays to a given type Future _increment( - ParseApiRQ apiRQType, String arrayAction, String key, num amount) async { + ParseApiRQ apiRQType, String countAction, String key, num amount) async { try { - var uri = "${ParseCoreData().serverUrl}$_path"; - var body = "{\"$key\":{\"__op\": \"$arrayAction\", \"amount\": $amount}"; + if (objectId != null) { + var uri = "${ParseCoreData().serverUrl}$_path/$objectId"; + var body = "{\"$key\":{\"__op\":\"$countAction\",\"amount\":$amount}}"; var result = await _client.put(uri, body: body); return handleResponse(this, result, apiRQType, _debug, className); + } else { + return null; + } } on Exception catch (e) { return handleException(e, apiRQType, _debug, className); }