Commit 28a47a876fdfa5bfe883a59d1c714996edb4340a
1 parent
f84b681d29
Exists in
master
and in
1 other branch
elimino variable innecesaria
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
src/js/service.js
1 | angular.module('focaCrearNotaPedido') | 1 | angular.module('focaCrearNotaPedido') |
2 | .service('crearNotaPedidoService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT) { | 2 | .service('crearNotaPedidoService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT) { |
3 | var route = API_ENDPOINT.URL; | 3 | var route = API_ENDPOINT.URL; |
4 | var notaPedido = undefined; | ||
5 | return { | 4 | return { |
6 | crearNotaPedido: function(notaPedido) { | 5 | crearNotaPedido: function(notaPedido) { |
7 | return $http.post(route + '/nota-pedido', {notaPedido: notaPedido}); | 6 | return $http.post(route + '/nota-pedido', {notaPedido: notaPedido}); |
8 | }, | 7 | }, |
9 | obtenerNotaPedido: function() { | 8 | obtenerNotaPedido: function() { |
10 | return $http.get(route +'/nota-pedido'); | 9 | return $http.get(route +'/nota-pedido'); |
11 | }, | 10 | }, |
12 | setNotaPedido: function(notaPedido) { | 11 | setNotaPedido: function(notaPedido) { |
13 | this.notaPedido = notaPedido; | 12 | this.notaPedido = notaPedido; |
14 | }, | 13 | }, |
15 | clearNotaPedido: function() { | 14 | clearNotaPedido: function() { |
16 | this.notaPedido = undefined; | 15 | this.notaPedido = undefined; |
17 | }, | 16 | }, |
18 | getNotaPedido: function() { | 17 | getNotaPedido: function() { |
19 | return this.notaPedido; | 18 | return this.notaPedido; |
20 | }, | 19 | }, |
21 | getArticulosByIdNotaPedido: function(id) { | 20 | getArticulosByIdNotaPedido: function(id) { |
22 | return $http.get(route+'/articulos/nota-pedido/'+id); | 21 | return $http.get(route+'/articulos/nota-pedido/'+id); |
23 | }, | 22 | }, |
24 | crearArticulosParaNotaPedido: function(articuloNotaPedido) { | 23 | crearArticulosParaNotaPedido: function(articuloNotaPedido) { |
25 | return $http.post(route + '/articulos/nota-pedido', | 24 | return $http.post(route + '/articulos/nota-pedido', |
26 | {articuloNotaPedido: articuloNotaPedido}); | 25 | {articuloNotaPedido: articuloNotaPedido}); |
27 | }, | 26 | }, |
28 | getDomiciliosByIdNotaPedido: function(id) { | 27 | getDomiciliosByIdNotaPedido: function(id) { |
29 | return $http.get(route +'/nota-pedido/'+id+'/domicilios'); | 28 | return $http.get(route +'/nota-pedido/'+id+'/domicilios'); |
30 | }, | 29 | }, |
31 | //EN DESARROLLO | 30 | //EN DESARROLLO |
32 | getDomicilios: function(id) { | 31 | getDomicilios: function(id) { |
33 | // return $http.get(route + '/'+id) | 32 | // return $http.get(route + '/'+id) |
33 | id='le asigno un valor para pasar pre commit'; | ||
34 | var domicilio = [ | 34 | var domicilio = [ |
35 | { | 35 | { |
36 | id: 1, | 36 | id: 1, |
37 | dom: 'RISSO PATRON 781' | 37 | dom: 'RISSO PATRON 781' |
38 | }, | 38 | }, |
39 | { | 39 | { |
40 | id: 2, | 40 | id: 2, |
41 | dom: 'MARIANO MORENO 533' | 41 | dom: 'MARIANO MORENO 533' |
42 | }, | 42 | }, |
43 | { | 43 | { |
44 | id: 3, | 44 | id: 3, |
45 | dom: 'SALTA 796' | 45 | dom: 'SALTA 796' |
46 | } | 46 | } |
47 | ]; | 47 | ]; |
48 | return domicilio; | 48 | return domicilio; |
49 | }, | 49 | }, |
50 | getPrecioCondicion: function() { | 50 | getPrecioCondicion: function() { |
51 | return $http.get(route + '/precio-condicion'); | 51 | return $http.get(route + '/precio-condicion'); |
52 | }, | 52 | }, |
53 | getPrecioCondicionById: function(id) { | 53 | getPrecioCondicionById: function(id) { |
54 | return $http.get(route + '/precio-condicion/' + id); | 54 | return $http.get(route + '/precio-condicion/' + id); |
55 | }, | 55 | }, |
56 | getPlazoPagoByPrecioCondicion: function(id) { | 56 | getPlazoPagoByPrecioCondicion: function(id) { |
57 | return $http.get(route + '/plazo-pago/precio-condicion/'+ id); | 57 | return $http.get(route + '/plazo-pago/precio-condicion/'+ id); |
58 | } | 58 | } |
59 | }; | 59 | }; |
60 | }]); | 60 | }]); |