<commit_before>angular.module('zeus.user', [])
  .controller('UserController', function($scope, User, $routeParams) {
    $scope.username = "wilson.palooza4";
    // $scope.userId = User.getUserId($scope.username)

    $scope.profilePic = "https://lh3.googleusercontent.com/-kKTmPYr4dZI/AAAAAAAAAAI/AAAAAAAAAMw/D7Ak_C3TSWY/photo.jpg";
    $scope.email = "<EMAIL>";
    $scope.reviews = {}; //or [];
    $scope.favorites = {}; // or [];

    var getUserReviews = function () {
      User.getUserReviews($scope.username) //username will change, so probably better to pass user id here
        .then(function(reviews) {
          console.log('------------------');
          console.log(reviews);
          $scope.reviews = reviews.data;

        });
    };
    getUserReviews();

    var getUserFavorites = function() {
      User.getUserFavorites($scope.username)
        .then(function(favorites) {
          $scope.favorites = favorites.data;
        });
    };
    getUserFavorites();
  });<commit_msg>- Uses getUserId to populate $scope variables for user based on username in routeParams<commit_after>angular.module('zeus.user', [])
  .controller('UserController', function($scope, User, $routeParams) {
    console.log('user page loaded');
    $scope.username = $routeParams.username;

    //set up user information based on username given in route
    User.getUserId($routeParams.username)
      .then(function(user){
        var userObj = user;
        console.log('--------- userObj -------');
        console.log(userObj);
        $scope.userId = userObj._id;
        $scope.profilePic = userObj.profilePicLink;
        $scope.email = userObj.email;
        $scope.favorites = userObj.favorites;
      });

    var getUserReviews = function () {
      User.getUserReviews($scope.username) //username will change, so probably better to pass user id here
        .then(function(reviews) {
          $scope.reviews = reviews.data;
        });
    };
    getUserReviews();

    var getUserFavorites = function() {
      User.getUserFavorites($scope.username)
        .then(function(favorites) {
          $scope.favorites = favorites.data;
        });
    };
    getUserFavorites();
  });
{'fraction_non_alphanumeric': 0.1541267669858641, 'fraction_numerical': 0.002279981760145919, 'mean_word_length': 2.638474295190713, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '81264', 'n_tokens_mistral': 674, 'n_tokens_neox': 661, 'n_words': 122}