From 906b1dd03544c54aeaccbf6e2a01797eb3727289 Mon Sep 17 00:00:00 2001 From: choelzl Date: Wed, 4 Aug 2021 14:51:33 +0200 Subject: [PATCH] fix attraction --- public/js/main.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/js/main.js b/public/js/main.js index e8725b8..3c0578b 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -29,9 +29,9 @@ const query_flight = (q)=>{ return axios.get(ENDPOINT).then(res=>res.data); } -const is_restauration_type = (t)=>{ +const is_restauration_type = (item)=>{ const arr = ["restaurant", "cafe", "pub", "bar", "fast_food", "food_court"]; - return arr.indexOf(t)!=-1; + return arr.indexOf(item.type)!=-1; } const is_attraction_type = (item)=>{ @@ -280,8 +280,8 @@ const app = new Vue({ }); this.debounceSave = _.debounce(this.save_data, 500) this.debounceSearch = {"hotel":_.debounce((q)=>{this.querying.hotel=true;this.search_nominatim(q,(r)=>(r.type=="hotel" || r.type=="hostel")).then((r)=>{this.querying.hotel=false});}, 500), - "restaurants":_.debounce((q)=>{this.querying.food=true;this.search_nominatim(q,(r)=>(is_restauration_type(r.type))).then((r)=>{this.querying.food=false});}, 500), - "places":_.debounce((q)=>{this.querying.place=true;this.search_nominatim(q,(r)=>(is_attraction_type(r.type))).then((r)=>{this.querying.place=false});}, 500), + "restaurants":_.debounce((q)=>{this.querying.food=true;this.search_nominatim(q,(r)=>(is_restauration_type(r))).then((r)=>{this.querying.food=false});}, 500), + "places":_.debounce((q)=>{this.querying.place=true;this.search_nominatim(q,(r)=>(is_attraction_type(r))).then((r)=>{this.querying.place=false});}, 500), "other":_.debounce((q)=>{this.querying.any=true;this.search_nominatim(q,(r)=>(true)).then((r)=>{this.querying.any=false});}, 500), "flight":_.debounce((q)=>this.search_flight(q), 500) }