Commit 7636d0391dbd24f799f57d39914d2c8bb657a7a5
1 parent
e98f052125
Exists in
master
Añadí propiedad idUsuario.
Showing
1 changed file
with
2 additions
and
1 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(actividad, observaciones) { | 6 | guardarPosicion: function(idUsuario, actividad, observaciones) { |
| 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 | actividad: actividad, | 13 | actividad: actividad, |
| 13 | observaciones: observaciones | 14 | observaciones: observaciones |
| 14 | } | 15 | } |
| 15 | }; | 16 | }; |
| 16 | return $http.post(API_ENDPOINT.URL + '/seguimiento', nuevaPosicion); | 17 | return $http.post(API_ENDPOINT.URL + '/seguimiento', nuevaPosicion); |
| 17 | }); | 18 | }); |
| 18 | } | 19 | } |
| 19 | }; | 20 | }; |
| 20 | } | 21 | } |
| 21 | ]); | 22 | ]); |
| 22 | 23 |