<commit_before>'use strict';

//TODO this should be Users service
angular.module('users.admin')
  .factory('AdminUserService', AdminUserService)
  .factory('AdminUserApi', AdminUserApi);

AdminUserService.$inject = ['$resource'];
function AdminUserService($resource) {
  return $resource('api/users/:aduserId', { aduserId: '@_id' }, {
    update: {
      method: 'PUT',
      ignoreLoadingBar: true
    },
  });
}
AdminUserApi.$inject = ['$http'];
function AdminUserApi($http) {
  this.loadAdminUsers = (page, condition) => {
    return $http.post('/api/admins/users/search', { condition: condition, page: page }, { ignoreLoadingBar: true });
  };
  this.generateUsers = (number, pass) => {
    return $http.get('/api/admins/users/generate/' + number + '/' + pass, { ignoreLoadingBar: true });
  };
  this.resetUserPassword = (userId, pass) => {
    return $http.post('/api/admins/users/' + userId + '/resetpass', { password: <PASSWORD> }, {
      ignoreLoadingBar: true
    });
  };
  this.loadAdminUserLogins = (userId, page, condition) => {
    return $http.post('/api/admins/users/' + userId + '/logins', { condition: condition, page: page }, { ignoreLoadingBar: true });
  };
  this.loadAdminUserPolls = (userId, page, condition) => {
    return $http.post('/api/admins/users/' + userId + '/polls', { condition: condition, page: page }, { ignoreLoadingBar: true });
  };
  this.loadAdminUserComments = userId => {
    return $http.post('/api/admins/users/' + userId + '/cmts', { condition: condition, page: page }, { ignoreLoadingBar: true });
  };
  this.get_votes_by_user = userId => {
    return $http.get('/api/admins/users/' + userId + '/votes', {
      ignoreLoadingBar: true
    });<commit_msg>Commited from HaNhatLenh at Tue, Oct 03, 2017 11:38:30 PM<commit_after>'use strict';

//TODO this should be Users service
angular.module('users.admin')
  .factory('AdminUserService', AdminUserService)
  .factory('AdminUserApi', AdminUserApi);

AdminUserService.$inject = ['$resource'];
function AdminUserService($resource) {
  return $resource('api/users/:aduserId', { aduserId: '@_id' }, {
    update: {
      method: 'PUT',
      ignoreLoadingBar: true
    },
  });
}
AdminUserApi.$inject = ['$http'];
function AdminUserApi($http) {
  this.loadAdminUsers = (page, condition) => {
    return $http.post('/api/admins/users/search', { condition: condition, page: page }, { ignoreLoadingBar: true });
  };
  this.generateUsers = (number, pass) => {
    return $http.get('/api/admins/users/generate/' + number + '/' + pass, { ignoreLoadingBar: true });
  };
  this.resetUserPassword = (userId, pass) => {
    return $http.post('/api/admins/users/' + userId + '/resetpass', { password: <PASSWORD> }, {
      ignoreLoadingBar: true
    });
  };
  this.loadAdminUserLogins = (userId, page, condition) => {
    return $http.post('/api/admins/users/' + userId + '/logins', { condition: condition, page: page }, { ignoreLoadingBar: true });
  };
  this.loadAdminUserPolls = (userId, page, condition) => {
    return $http.post('/api/admins/users/' + userId + '/polls', { condition: condition, page: page }, { ignoreLoadingBar: true });
  };
  this.loadAdminUserComments = (userId, page, condition) => {
    return $http.post('/api/admins/users/' + userId + '/cmts', { condition: condition, page: page }, { ignoreLoadingBar: true });
  };
  this.get_votes_by_user = userId => {
    return $http.get('/api/admins/users/' + userId + '/votes', {
      ignoreLoadingBar: true
    });
{'fraction_non_alphanumeric': 0.18244604316546761, 'fraction_numerical': 0.0034532374100719426, 'mean_word_length': 3.923512747875354, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '135448', 'n_tokens_mistral': 1112, 'n_tokens_neox': 1110, 'n_words': 229}