Skip to content

Instantly share code, notes, and snippets.

View ykabbara's full-sized avatar

Yusuf Kabbara ykabbara

View GitHub Profile
const Tour = require('../models/tour.model.js');
exports.searchPackages = async (req, res)=>{
const searchParams = req.query;
const kids= searchParams.kids || "2";
const solo =searchParams.solo || "2";
let startTime = searchParams.startTime || 0;
let endTime = searchParams.endTime || 0;
let day = (endTime - startTime) / (24*3600*1000) - 1; // divide by one day in seconds