Commit 293ce78751deff810ddaf7aba3106cdd69f9d271
1 parent
51a5b48565
Exists in
master
and in
1 other branch
console para debug
Showing
1 changed file
with
1 additions
and
0 deletions
Show diff stats
src/js/service.js
1 | angular.module('focaSeguimiento') | 1 | angular.module('focaSeguimiento') |
2 | .service('focaSeguimientoService', [ | 2 | .service('focaSeguimientoService', [ |
3 | '$http', 'API_ENDPOINT', 'cordovaGeolocationService', | 3 | '$http', 'API_ENDPOINT', 'cordovaGeolocationService', |
4 | function($http, API_ENDPOINT, cordovaGeolocationService) { | 4 | function($http, API_ENDPOINT, cordovaGeolocationService) { |
5 | return { | 5 | return { |
6 | guardarPosicion: function(idUsuario, actividad, observaciones, sucursal) { | 6 | guardarPosicion: function(idUsuario, actividad, observaciones, sucursal) { |
7 | cordovaGeolocationService.getCurrentPosition(function(posicion) { | 7 | cordovaGeolocationService.getCurrentPosition(function(posicion) { |
8 | var nuevaPosicion = { | 8 | var nuevaPosicion = { |
9 | posicion: { | 9 | posicion: { |
10 | latitud: posicion.coords.latitude, | 10 | latitud: posicion.coords.latitude, |
11 | longitud: posicion.coords.longitude, | 11 | longitud: posicion.coords.longitude, |
12 | idUsuario: idUsuario, | 12 | idUsuario: idUsuario, |
13 | sucursal: sucursal, | 13 | sucursal: sucursal, |
14 | actividad: actividad, | 14 | actividad: actividad, |
15 | observaciones: observaciones | 15 | observaciones: observaciones |
16 | } | 16 | } |
17 | }; | 17 | }; |
18 | console.info(nuevaPosicion); | ||
18 | return $http.post(API_ENDPOINT.URL + '/seguimiento', nuevaPosicion); | 19 | return $http.post(API_ENDPOINT.URL + '/seguimiento', nuevaPosicion); |
19 | }); | 20 | }); |
20 | } | 21 | } |
21 | }; | 22 | }; |
22 | } | 23 | } |
23 | ]); | 24 | ]); |
24 | 25 |