removeUser method

Future<SuccessResponse> removeUser({
  1. required String userId,
})

Delete a user and all their sessions and accounts. Cannot be undone.

userId The ID of the user to delete

Implementation

Future<SuccessResponse> removeUser({required String userId}) async {
  try {
    final response = await super.dio.post(
      "/admin/remove-user",
      data: {"userId": userId},
      options: await super.getOptions(isTokenRequired: true),
    );
    return SuccessResponse.fromJson(response.data);
  } catch (e) {
    final message = getErrorMessage(e);
    if (message == null) rethrow;
    throw message;
  }
}