def METHOD_NAME(
    self,
    request: Request,
    organization: Organization,
    member: OrganizationMember,
) -> Response:
    """
    Update an invite request to Organization
    ````````````````````````````````````````
    Update and/or approve an invite request to an organization.
    :pparam string organization_slug: the slug of the organization the member will belong to
    :param string member_id: the member ID
    :param boolean approve: allows the member to be invited
    :param string role: the suggested role of the new member
    :param string orgRole: the suggested org-role of the new member
    :param array teams: the teams which the member should belong to.
    :param array teamRoles: the teams and team-roles assigned to the member
    :auth: required
    """
    serializer = OrganizationMemberSerializer(
        data=request.data,
        context={"organization": organization, "allowed_roles": roles.get_all()},
        partial=True,
    )
    if not serializer.is_valid():
        return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
    result = serializer.validated_data
    if result.get("orgRole"):
        member.role = result["orgRole"]
        member.save()
    elif result.get("role"):
        member.role = result["role"]
        member.save()
    # Do not set team-roles when inviting members
    if "teamRoles" in result or "teams" in result:
        teams = (
            [team for team, _ in result.get("teamRoles")]
            if "teamRoles" in result and result["teamRoles"]
            else result.get("teams")
        )
        save_team_assignments(member, teams)
    if "approve" in request.data:
        allowed_roles = get_allowed_org_roles(request, organization)
        serializer = ApproveInviteRequestSerializer(
            data=request.data,
            context={
                "request": request,
                "organization": organization,
                "member": member,
                "allowed_roles": allowed_roles,
            },
        )
        if not serializer.is_valid():
            return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
        result = serializer.validated_data
        if result.get("approve") and not member.invite_approved:
            api_key = get_api_key_for_audit_log(request)
            member.approve_member_invitation(
                request.user,
                api_key,
                request.META["REMOTE_ADDR"],
                request.data.get("referrer"),
            )
    return Response(
        serialize(member, serializer=OrganizationMemberWithTeamsSerializer()),
        status=status.HTTP_200_OK,
    )