diff --git a/src/js/controller.js b/src/js/controller.js index 6698787..37aa8fb 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -224,8 +224,8 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo } function eliminarVehiculo(vehiculo) { - focaLogisticaPedidoRutaService.getRemitos(vehiculo.id).then(function(res) { - if(!focaLogisticaPedidoRutaService.obtenerRemitosDeCarga(res.data).length) { + focaLogisticaPedidoRutaService.getRemitosByIdVehiculo(vehiculo.id).then(function(res) { + if(!res.data.length) { $scope.vehiculos.splice($scope.vehiculos.indexOf(vehiculo), 1); }else { focaModalService.alert('No ha sido posible eliminar el vehiculo porque ' +