updateStatus method

Future<User> updateStatus()

Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.

Implementation

Future<models.User> updateStatus() async {
  final String apiPath = '/account/status';

  final Map<String, dynamic> apiParams = {};

  final Map<String, String> apiHeaders = {
    'X-Appwrite-Project': client.config['project'] ?? '',
    'content-type': 'application/json',
    'accept': 'application/json',
  };

  final res = await client.call(
    HttpMethod.patch,
    path: apiPath,
    params: apiParams,
    headers: apiHeaders,
  );

  return models.User.fromMap(res.data);
}