{"size": 577, "ext": "js", "max_stars_repo_path": "src/services/post-user.service.js", "max_stars_repo_name": "Ramon8888/pp-ramon-arellano-front", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/services/post-user.service.js", "max_issues_repo_name": "Ramon8888/pp-ramon-arellano-front", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/services/post-user.service.js", "max_forks_repo_name": "Ramon8888/pp-ramon-arellano-front", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.2272727273, "max_line_length": 91, "alphanum_fraction": 0.5580589255}
import config from '../common/config';

export default {
  name: 'postUsersService',
  factory: ['$http', 'localStorageService', ($http, localStorageService) => {
    function postUsers(data) {
        var users = localStorageService.get('users'); 
        if(users != null){
            users.push(data);
        localStorageService.set('users');
        }
        
        return $http.post(config.api.base + config.api.resources.add, data, config.headers)
          .catch(error => {
            return error;
          });
      }
    return {
      postUsers
    };
  }]
}