service.js
806 Bytes
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);
},
guardarChofer: function(chofer) {
return $http.post(API_ENDPOINT.URL + '/chofer', {chofer: chofer});
},
getTransportistas: function() {
return $http.get(API_ENDPOINT.URL + '/transportista');
},
deleteChofer: function(id) {
return $http.delete(API_ENDPOINT.URL + '/chofer/' + id);
}
};
}]);