Commit a1a13ea1471cf9de856245ddf1cb3108616eb992

Authored by Eric Fernandez
1 parent 5d9ded8902
Exists in master

factory

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
1 angular.module('focaLogin') 1 angular.module('focaLogin')
2 .service('focaLoginService', [ 2 .factory('focaLoginService', [
3 '$http', 'API_ENDPOINT', 'APP', '$cookies', 3 '$http', 'API_ENDPOINT', 'APP', '$cookies',
4 function($http, API_ENDPOINT, APP, $cookies) { 4 function($http, API_ENDPOINT, APP, $cookies) {
5 return { 5 return {
6 login: function(usuario) { 6 login: function(usuario) {
7 if (APP) { 7 if (APP) {
8 APP = '/' + APP; 8 APP = '/' + APP;
9 } 9 }
10 10
11 return $http.post(API_ENDPOINT.URL + '/usuario/login' + APP , usuario); 11 return $http.post(API_ENDPOINT.URL + '/usuario/login' + APP , usuario);
12 }, 12 },
13 getLoginData: function() { 13 getLoginData: function() {
14 if ($cookies.get('chofer')) { 14 if ($cookies.get('chofer')) {
15 return {chofer: $cookies.get('chofer')}; 15 return {chofer: $cookies.get('chofer')};
16 } 16 }
17 17
18 if ($cookies.get('vendedorCobrador')) { 18 if ($cookies.get('vendedorCobrador')) {
19 return {vendedorCobrador: $cookies.get('vendedorCobrador')}; 19 return {vendedorCobrador: $cookies.get('vendedorCobrador')};
20 } 20 }
21 } 21 }
22 }; 22 };
23 } 23 }
24 ]); 24 ]);
25 25