feat: use drink api in front and more #16

Merged
Clement merged 47 commits from feat/use-drink-api-in-front into master 2024-06-07 17:09:58 +00:00
3 changed files with 30 additions and 5 deletions
Showing only changes of commit 79f63d2cd1 - Show all commits

View File

@ -136,9 +136,8 @@ export async function getCity(req: express.Request, res: express.Response) {
radius = "1000"
}
const cityPose = await callCity(cityName as string)
const poi = await callRadius(cityPose.lon,cityPose.lat, radius as string)
res.send( {...poi, ...cityPose})
}//XXX: refaire test avec city
res.send( await callRadius(cityPose.lon,cityPose.lat, radius as string))
}
/**
* Handle GET request for radius search route ('/otm/radius').
@ -184,12 +183,19 @@ export async function getBox(req:express.Request, res: express.Response) {
const lat1 = req.query["lat1"] as string
const lon2 = req.query["lon2"] as string
const lat2 = req.query["lat2"] as string
const rate = req.query["rate"] as string
let rate = req.query["rate"] as string
if(!lon1 || !lat1 || !lon2 || !lat2){
res.status(400).send("Missing Argument")
return
}
console.log("RATE: ", rate);
if(!rate){
rate = "1";
}
console.log("RATE: ", rate);
res.send( await callBox(lon1, lat1, lon2, lat2, rate))
}

View File

@ -0,0 +1,18 @@
{
"folders": [
{
"name": "Ratrapage_WEB",
"path": "."
},
{
"name": "barAndCafe",
"path": "Express/barAndCafe"
},
{
"path": "front"
}
],
"settings": {
"typescript.tsdk": "node_modules/typescript/lib"
}
}

View File

@ -104,7 +104,8 @@ console.log(fav);
const icon = {icon: new L.Icon({iconUrl: markerIcon.src, shadowUrl: markerShadow.src, iconAnchor: [13,41]})}
const BACK_URL = "http://localhost:3001/" //XXX : mettre url de prod
// const BACK_URL = "http://localhost:3001/" //XXX : mettre url de prod
const BACK_URL = "https://drink-tweb.cb85.fr/" //XXX : mettre url de prod
// declare map
const map = L.map('map', {