dev #160

Merged
sora merged 97 commits from dev into master 2025-03-02 01:09:30 +01:00
Showing only changes of commit 6ec4d426c9 - Show all commits

View File

@ -10,6 +10,14 @@ setGlobalDispatcher(new ProxyAgent(process.env.HTTPS_PROXY as string));
export default function (server, opts, done) { export default function (server, opts, done) {
server.get("/flight/:id", async (req, reply) => server.get("/flight/:id", async (req, reply) =>
flight_get_data(req.params.id) flight_get_data(req.params.id)
.then(res => {
let wait_for_all: Promise<any>[] = []
res.forEach(r => {
wait_for_all.push(nominatim_get_data(r.from).then(geo => (r as any).from_geo = geo[0]));
wait_for_all.push(nominatim_get_data(r.to).then(geo => (r as any).to_geo = geo[0]));
});
return Promise.all(wait_for_all).then(_ => res)
})
.then(res => reply.send(res)) .then(res => reply.send(res))
); );