def METHOD_NAME(request, project_guid):
    """Update ProjectCategories for the given project.
    Args:
        project_guid (string): GUID of the project that should be updated
    HTTP POST
        Request body - should contain the following json structure:
        {
            'form' : {
                'categories': a list of category GUIDs for the categories assigned to the given project
            }
        }
        Response body - will contain the following structure, representing the updated project,
            as well all categories in seqr:
            {
                'projectsByGuid':  {
                    <projectGuid1> : { ... <project key-value pairs> ... }
                }
                'projectCategoriesByGuid':  {
                    <projectCategoryGuid1> : { ... <category key-value pairs> ... }
                    <projectCategoryGuid2> : { ... <category key-value pairs> ... }
                }
            }
    """
    project = Project.objects.get(guid=project_guid)
    # check permissions
    check_project_permissions(project, request.user, can_edit=True)
    request_json = json.loads(request.body)
    # project categories according to the UI
    current_category_guids = set(request_json['projectCategoryGuids'])
    project_categories_by_guid = _update_project_categories(project, request.user, current_category_guids)
    projects_by_guid = {
        project.guid: _get_json_for_project(project, request.user)
    }
    return create_json_response({
        'projectsByGuid': projects_by_guid,
        'projectCategoriesByGuid': project_categories_by_guid,
    })