<commit_before>app.factory('BioFactory', ['$http', function($http){
  console.log('BioFactory running');

  var mentors = {};
  var mentorBio = {};
  var mentorId;

  // gets all the mentors that match the newSearch selected fields
  function getMentors(newSearch){
    console.log("NEW SEARCH:", newSearch);
    var newSearchString = JSON.stringify(newSearch);
    return $http({
        method: 'GET',
        url: '/mentor-search/search',
        headers: {
          newSearchString: newSearchString
        }
      })
      .then(function(response) {
        mentors.info = response.data;
        console.log("Mentors list:", mentors);
      }),
      function(err) {
        console.log("Error with search get request ", err);
      };
  };

  // gets profiles associated with the mentor

  function getProfiles(){
    console.log(mentorId);
    return $http.get('/profile/' + mentorId)
    .then(function (response) {
      console.log(response);
    })
    .catch(function (error) {
      console.log('An error has occurred');
    });
  }


// Attach the chosen mentor object to the info property on mentorBio.
// This will be accessed by the profile controller
  function setMentor(mentor){
    mentorBio.info = mentor;
    mentorId = mentorBio.info.id;
    console.log("MENTOR:", mentorBio.info);
  }

  function setMentorId(id){

    mentorId = id;
    console.log('MENTOR ID:', mentorId);
  }<commit_msg>Minor change<commit_after>app.factory('BioFactory', ['$http', function($http){
  console.log('BioFactory running');

  var mentors = {};
  var mentorBio = {};
  var mentorId;

  // gets all the mentors that match the newSearch selected fields
  function getMentors(newSearch){
    console.log("NEW SEARCH:", newSearch);
    var newSearchString = JSON.stringify(newSearch);
    return $http({
        method: 'GET',
        url: '/mentor-search/search',
        headers: {
          newSearchString: newSearchString
        }
      })
      .then(function(response) {
        mentors.info = response.data;
        console.log("Mentors list:", mentors);
      }),
      function(err) {
        console.log("Error with search get request ", err);
      };
  };

  // gets profiles associated with the mentor

  function getProfiles(){
    console.log("MENTOR ID IN getProfiles()", mentorId);
    return $http.get('/profile/' + mentorId)
    .then(function (response) {
      console.log(response);
    })
    .catch(function (error) {
      console.log('An error has occurred');
    });
  }


// Attach the chosen mentor object to the info property on mentorBio.
// This will be accessed by the profile controller
  function setMentor(mentor){
    mentorBio.info = mentor;
    mentorId = mentorBio.info.id;
    console.log("MENTOR:", mentorBio.info);
  }

  function setMentorId(id){

    mentorId = id;
    console.log('MENTOR ID:', mentorId);
  }
{'fraction_non_alphanumeric': 0.13247116392869626, 'fraction_numerical': 0.0, 'mean_word_length': 2.836461126005362, 'pattern_counts': {'":': 0, '<': 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': '124954', 'n_tokens_mistral': 896, 'n_tokens_neox': 845, 'n_words': 217}