<commit_before>$(function() {
    session.checkSession(function(result) {
        carCompanyRedirect(result, loadHistory);
    });
});

function loadHistory() {
    $.ajax({
        url: "https://sejeqwt9og.execute-api.us-west-2.amazonaws.com/Dev/getdatasethistory",
        data: session.getUserID(),
        type: "GET",
        headers: {
            "Authorization": session.getToken(),
            "Content-Type": "application/json"
        },
        success: function(result) {
            console.log(session.getUserID());
            var historicalItems = result.history;
            // console.log(historicalItems)
            let historicalTable = $('#myDatasets');
            if (historicalItems.length > 0) {
                for (var i = 0; i < historicalItems.length; i++) {
                    let row = $('<tr id="row-' + historicalItems[i].datasetName.split('.')[0] + '"></tr>').appendTo(historicalTable);
                    $('<td>' + (i + 1) + '</td>').appendTo(row);
                    $('<td>' + historicalItems[i].datasetName + '</td>').appendTo(row);
                    $('<td>' + historicalItems[i].purchasedDate + '</td>').appendTo(row);
                }
                historicalItems.forEach(function(historicalItem) {
                    let row = $('<tr id="row-' + historicalItem.split('.')[0] + '"></tr>').appendTo(historicalTable);
                    $('<td>' + counter + '</td>').appendTo(row);
                    $('<td>' + historicalItem + '</td>').appendTo(row);
                });
            } else {
                $('#tableDiv').css('display', 'none');
                $('#displayNone').append("<h3>You haven't made any purchases!</h3>")
            }
        }
    });
}

cart.refreshCart(function() {
    console.log('DONE')
});
<commit_msg>Can we redirect to datasetHistory instead?<commit_after>$(function() {
    session.checkSession(function(result) {
        carCompanyRedirect(result, loadHistory);
    });
});

function loadHistory() {
    $.ajax({
        url: "https://sejeqwt9og.execute-api.us-west-2.amazonaws.com/Dev/getdatasethistory",
        data: session.getUserID(),
        type: "GET",
        headers: {
            "Authorization": session.getToken(),
            "Content-Type": "application/json"
        },
        success: function(result) {
            console.log(session.getUserID());
            var historicalItems = result.history;
            // console.log(historicalItems)
            let historicalTable = $('#myDatasets');
            if (historicalItems.length > 0) {
                for (var i = 0; i < historicalItems.length; i++) {
                    let row = $('<tr id="row-' + historicalItems[i].datasetName.split('.')[0] + '"></tr>').appendTo(historicalTable);
                    
                    var tableID = $("<td></td>").text((i + 1));
                    
                    var aTag = $("<a></a>").text(historicalItems[i].datasetName);
                    aTag.attr("href", "https://s3-us-west-2.amazonaws.com/roadio-datasets/" + historicalItems[i].datasetName);
                    var newTag = $("<td></td>").html(aTag);
                    
                    var newPurchasedDate = $("<td></td>").text(historicalItems[i].purchasedDate);
                    
                    row.append(tableID, newTag, newPurchasedDate)
                }
            } else {
                $('#tableDiv').css('display', 'none');
                $('#displayNone').append("<h3>You haven't made any purchases!</h3>")
            }
        }
    });
}

cart.refreshCart(function() {
    console.log('DONE')
});

{'fraction_non_alphanumeric': 0.1786208806424813, 'fraction_numerical': 0.005261700360011078, 'mean_word_length': 1.868943606036537, 'pattern_counts': {'":': 4, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2957557', 'n_tokens_mistral': 1048, 'n_tokens_neox': 1008, 'n_words': 155}