<commit_before>$("#restaurant-search-form").on("submit", function(event) {
  event.preventDefault();
  var restaurant = $(":input[name=restaurant]", this).val();
  app.getRecipeByRestaurant(restaurant);
});

// @param

app.getRecipeByRestaurant = function getRecipeByRestaurant(restaurant) {

  console.log("app.getRecipeByRestaurant() has been called. The user searched for" + restaurant);

  var ajaxArgument = {
    type: 'get',
    url: 'http://localhost:3000/recipes/' + restaurant,
    dataType: 'json',
    success: function(data) {
        console.log("success");
        console.log(data);


    },
    error: function(error) {
        console.log("error")
        console.log(error);
    }
};
// make the ajax call
$.ajax(ajaxArgument);<commit_msg>additional info added to ajax.js<commit_after>$("#restaurant-search-form").on("submit", function(event) {
  event.preventDefault();
  var restaurant = $(":input[name=restaurant]", this).val();
  app.getRecipeByRestaurant(restaurant);
});

// @param

app.getRecipeByRestaurant = function getRecipeByRestaurant(restaurant) {

  console.log("app.getRecipeByRestaurant() has been called. The user searched for" + restaurant);

  var ajaxArgument = {
    type: 'get',
    url: 'http://localhost:3000/recipes/' + restaurant,
    dataType: 'json',
    success: function(data) {
        console.log("success");
        console.log(data);
        
        var recipeTemplate = $('#recipe-template').html();
        console.log('Transforming template');
        var compileTpl = _.template(recipeTemplate);
        console.log('Creating HTML from template & model data');
        var html = compileTpl(data);
        // console.log(html);
        console.log('Rendering to page....');
        $('#recipe-listing').html("");

        $('#recipe-listing').append(html);

    },
    error: function(error) {
        console.log("error")
        console.log(error);
    }
};
// make the ajax call
$.ajax(ajaxArgument);
{'fraction_non_alphanumeric': 0.16462793068297654, 'fraction_numerical': 0.004077471967380225, 'mean_word_length': 3.401345291479821, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '3485525', 'n_tokens_mistral': 615, 'n_tokens_neox': 579, 'n_words': 112}