Fix for Fastify4
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
soraefir
2023-06-14 15:34:42 +02:00
parent b735dcc0b8
commit 5d5c9d9f37
2 changed files with 20 additions and 44 deletions

View File

@ -19,25 +19,12 @@ Date.prototype.toJSONLocal = (function() {
};
}())
const query_nominatim = (q,f)=>{
const ENDPOINT = '/api/place/'+q;
return axios.get(ENDPOINT).then(res=>res.data).then(res=>res.filter(f));
}
const query_nominatim = (q,f) => axios.get('/api/place/'+q).then(res=>res.data).then(res=>res.filter(f))
const query_flight = (q) => axios.get('/api/flight/'+q).then(res=>res.data)
const query_flight = (q)=>{
const ENDPOINT = '/api/flight/'+q;
return axios.get(ENDPOINT).then(res=>res.data);
}
const is_restauration_type = e => ["restaurant", "cafe", "pub", "bar", "fast_food", "food_court"].indexOf(e.type)!=-1;
const is_restauration_type = (item)=>{
const arr = ["restaurant", "cafe", "pub", "bar", "fast_food", "food_court"];
return arr.indexOf(item.type)!=-1;
}
const is_attraction_type = (item)=>{
const arr = ["tourism", "leisure", "place", "amenity", "highway"];
return arr.indexOf(item.category)!=-1;
}
const is_attraction_type = e => ["tourism", "leisure", "place", "amenity", "highway"].indexOf(e.category)!=-1;
const icon_type = (item)=>{
let t = item.type
@ -111,7 +98,7 @@ const app = new Vue({
window.location.href = '/'+this.journey_id;
},
add_section: function(event){
if(this.journey_data.main===undefined) this.journey_data.main=[];
if(this.journey_data.main==undefined) this.journey_data.main=[];
this.journey_data.main.push({map:{zoom:2}, hotel:{latlon:[0,0]},places:{restaurants:[],places:[]}});
},
next_step: function(){
@ -242,6 +229,7 @@ const app = new Vue({
save_data: function(){
this.impexp = window.btoa(JSON.stringify(this.journey_data));
console.log(this.journey_data)
axios.post('/api/'+this.journey_id, this.journey_data).then(response => {
console.log("Saved...")
}).catch(error => {
@ -268,7 +256,10 @@ const app = new Vue({
},
created: function () {
axios.get('/api/'+this.journey_id).then(response =>{
console.log(response)
if(response.data=='') throw "Invalid Journey Data Received";
app.journey_data = response.data;
for(let e of app.journey_data.main){
if(e.dateRange && e.dateRange.length===2){
e.dateRange[0]= new Date(e.dateRange[0]);