destroy method

Future<ParseResponse?> destroy()

Removes a user from Parse Server locally and online

Implementation

Future<ParseResponse?> destroy() async {
  if (objectId != null) {
    try {
      final Uri url = getSanitisedUri(_client, '$_path/$objectId');
      final ParseNetworkResponse response = await _client.delete(
        url.toString(),
      );
      return await _handleResponse(
        this,
        response,
        ParseApiRQ.destroy,
        _debug,
        parseClassName,
      );
    } on Exception catch (e) {
      return handleException(e, ParseApiRQ.destroy, _debug, parseClassName);
    }
  }

  return null;
}