service.js
1.38 KB
angular.module('focaAbmChofer')
.factory('focaAbmChoferService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT) {
return {
getChoferes: function() {
return $http.get(API_ENDPOINT.URL + '/chofer');
},
getChofer: function(id) {
return $http.get(API_ENDPOINT.URL + '/chofer/' + id);
},
getChoferPorTransportista: function(id) {
return $http.get(API_ENDPOINT.URL + '/chofer/transportista/' + id);
},
getChoferPorDni: function(dni) {
return $http.post(API_ENDPOINT.URL + '/chofer/dni', {dni: dni});
},
guardarChofer: function(chofer) {
return $http.post(API_ENDPOINT.URL + '/chofer', {chofer: chofer});
},
getTransportistas: function() {
return $http.get(API_ENDPOINT.URL + '/transportista');
},
getTransportistaPorId: function(id) {
return $http.get(API_ENDPOINT.URL + '/transportista/' + id);
},
deleteChofer: function(id) {
return $http.delete(API_ENDPOINT.URL + '/chofer/' + id);
},
getTiposDocumento: function() {
return $http.get(API_ENDPOINT.URL + '/tipo-documento');
},
transportistaSeleccionado: {}
};
}]);