Compare commits

..

2 Commits

Author SHA1 Message Date
61390214dd fix filtre reset issue
Some checks failed
Build Docker Image Front / run (pull_request) Failing after 39s
Build Docker Image Back / run (pull_request) Successful in 1m7s
JsDocs / coverage (pull_request) Successful in 39s
Test and coverage / coverage (pull_request) Failing after 1m26s
2024-06-04 22:29:14 +02:00
9a935a922d update back for rate 2024-06-04 22:27:50 +02:00
2 changed files with 5 additions and 3 deletions

View File

@ -13,7 +13,7 @@ const key = process.env.OPEN_TRIP_MAPS_KEY
* @param {string} lat2 Latitude of the 2nd point of the box
* @returns {FeatureCollection} a list of POIs with their type, id, etc. (cf: [opentripmap](https://dev.opentripmap.org/docs#))
*/
async function callBox(lon1:string, lat1:string, lon2: string, lat2: string) {
async function callBox(lon1:string, lat1:string, lon2: string, lat2: string, rate: string) {
const lonMin = Math.min(parseFloat(lon1), parseFloat(lon2))
const lonMax = Math.max(parseFloat(lon1), parseFloat(lon2))
const latMin = Math.min(parseFloat(lat1), parseFloat(lat2))
@ -27,6 +27,7 @@ async function callBox(lon1:string, lat1:string, lon2: string, lat2: string) {
lon_max: lonMax,
lat_min: latMin,
lat_max: latMax,
rate: rate,
apikey: key,
kinds: 'bars,cafes,pubs,biergartens'
},
@ -183,11 +184,12 @@ 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
if(!lon1 || !lat1 || !lon2 || !lat2){
res.status(400).send("Missing Argument")
return
}
res.send( await callBox(lon1, lat1, lon2, lat2))
res.send( await callBox(lon1, lat1, lon2, lat2, rate))
}

View File

@ -192,7 +192,7 @@ const metadata = {
document.querySelectorAll<HTMLInputElement>('input[name="note-min"]').forEach(e => {
e.addEventListener("click", () => {
minimalNote = e.value
})
searchBox()
})
})
</script>