fixes: directions api change

This commit is contained in:
Alexandro Uc Santos
2024-04-20 16:59:12 -06:00
parent 18920ac2fc
commit 2ce0fd01a4
6 changed files with 95 additions and 38 deletions

View File

@@ -8,7 +8,7 @@
import { useAuthStore } from '../stores/auth';
import { useCompanyStore } from '../stores/company';
import { useVehiclesStore } from '../stores/vehicles';
import { saveProposal } from '../services/vehicles'
// import { saveProposal } from '../services/vehicles'
import Swal from 'sweetalert2';
const mapKey = import.meta.env.VITE_MAP_KEY;
@@ -57,7 +57,6 @@
});
const initData = async() => {
console.log('load: ', props.load);
isLoading.value = true;
let filterQuery = [];
filterQuery.company = "company="+ authStore.user.company
@@ -66,7 +65,7 @@
destinationCoords.value = {lat: Number.parseFloat(props.load.destination.lat), lng: Number.parseFloat(props.load.destination.lng)};;
polylines.value = await getDirections(originCoords.value, destinationCoords.value);
isLoading.value = false;
console.log(props.proposal);
// console.log(props.proposal);
if(props.proposal) {
form.vehicle = props.proposal.vehicle._id;
form.comments = props.proposal.comment;
@@ -121,7 +120,7 @@
}
const index = vehiclesStore.vehicles.findIndex((prop) => prop._id === form.vehicle);
const vehicleSelected = vehiclesStore.vehicles[index];
console.log(vehicleSelected);
// console.log(vehicleSelected);
const localData = {
vehicle: vehicleSelected,
load: props.load,