Skip to content

Commit

Permalink
added via route
Browse files Browse the repository at this point in the history
  • Loading branch information
Legend101Zz committed Nov 5, 2023
1 parent 103df89 commit ab16ef1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
MONGODB_URI=mongodb+srv://App_Project:[email protected]/Rodhak?retryWrites=true&w=majority
GMAIL_MAIL=[email protected]
GMAIL_PASSWORD=odtyaahzncpenuic
CLOUDINARY_CLOUD_NAME=dzu5yyg7e
CLOUDINARY_KEY=162359982151643
CLOUDINARY_SECRET=l4-1wvcK-HGK6kWKgYHUkgI6JXI
JWTSECRETKEY= thisshouldBeaMUCHbetterPrivateKEYY
MAP_BOX=pk.eyJ1IjoibXJpZ2VzaHRoYWt1ciIsImEiOiJjbDdwdjZ2MG4wbGVmM3JzMzVtb2U1MnJ0In0.nbEGuAgv1N1c-tXDyR7d4g
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
node_modules
.env
6 changes: 5 additions & 1 deletion controllers/driver.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ module.exports.createTripApi = async (req, res, next) => {

const starting = req.body.sourceLocation;
const ending = req.body.destinationLocation;

const viaRoute = req.body.viaRoute;
const start_time = req.body.start_time;

// console.log("req body check", req.body);
Expand All @@ -457,6 +457,7 @@ module.exports.createTripApi = async (req, res, next) => {
coordinateEnd: ending,
Start: start,
End: end,
viaRoute,
start_time: start_time,
});

Expand Down Expand Up @@ -488,6 +489,7 @@ module.exports.createTripApi = async (req, res, next) => {
location1: start,
location2: end,
vehicle_num: veh,
viaRoute,
type: vehicle.Type,
TripId: result._id,
start_time: start_time,
Expand All @@ -511,6 +513,7 @@ module.exports.createTripApi = async (req, res, next) => {
coordinateEnd: ending,
Start: start,
End: end,
viaRoute,
start_time: start_time,
});

Expand Down Expand Up @@ -542,6 +545,7 @@ module.exports.createTripApi = async (req, res, next) => {
vehicle_num: veh,
type: vehicle.Type,
TripId: result._id,
viaRoute,
start_time: start_time,
},
});
Expand Down
3 changes: 3 additions & 0 deletions models/trip.schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ const TripSchema = new Schema({
coordinateEnd: {
type: [Number],
},
viaRoute: {
type: String,
},
});

TripSchema.plugin(require("mongoose-autopopulate"));
Expand Down

0 comments on commit ab16ef1

Please sign in to comment.