From 79f63d2cd18cdd0a7c3d0668df2039028f91f09a Mon Sep 17 00:00:00 2001 From: Clement Date: Fri, 7 Jun 2024 17:37:12 +0200 Subject: [PATCH] test fix test --- Express/barAndCafe/src/openTripMaps.ts | 14 ++++++++++---- Ratrapage_WEB.code-workspace | 18 ++++++++++++++++++ front/src/pages/maps/index.astro | 3 ++- 3 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 Ratrapage_WEB.code-workspace diff --git a/Express/barAndCafe/src/openTripMaps.ts b/Express/barAndCafe/src/openTripMaps.ts index c366b4a..7d39951 100644 --- a/Express/barAndCafe/src/openTripMaps.ts +++ b/Express/barAndCafe/src/openTripMaps.ts @@ -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)) } diff --git a/Ratrapage_WEB.code-workspace b/Ratrapage_WEB.code-workspace new file mode 100644 index 0000000..f6c581d --- /dev/null +++ b/Ratrapage_WEB.code-workspace @@ -0,0 +1,18 @@ +{ + "folders": [ + { + "name": "Ratrapage_WEB", + "path": "." + }, + { + "name": "barAndCafe", + "path": "Express/barAndCafe" + }, + { + "path": "front" + } + ], + "settings": { + "typescript.tsdk": "node_modules/typescript/lib" + } +} \ No newline at end of file diff --git a/front/src/pages/maps/index.astro b/front/src/pages/maps/index.astro index 78fbb50..0e20f8f 100644 --- a/front/src/pages/maps/index.astro +++ b/front/src/pages/maps/index.astro @@ -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', {