changeRole method

Future<Response> changeRole(
  1. String idOrEmail,
  2. String newRoleName
)

Change a user's global role

Implementation

Future<Response> changeRole(String idOrEmail, String newRoleName) async {
  try {
    final response = await _dio.patch(
      '/users/$idOrEmail/role',
      data: {
        'newRoleName': newRoleName,
      },
    );
    return response;
  } on DioException catch (e) {
    throw Exception('Failed to change user role: ${e.message}');
  }
}