Skip to content

Commit

Permalink
reducir cantidad de json
Browse files Browse the repository at this point in the history
  • Loading branch information
catdevnull committed Jan 9, 2025
1 parent 9d7d10b commit 3f85cd3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
12 changes: 6 additions & 6 deletions sitio-sveltekit/src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ export interface Flight {
estes?: string;
};
matricula: string;
aeronave: string;
msn: string;
compania_aerea: string;
situacion: string;
detail_url: string;
edad_del_avion: number;
// aeronave: string;
// msn: string;
// compania_aerea: string;
// situacion: string;
// detail_url: string;
// edad_del_avion: number;
config_de_asientos: string;
}

Expand Down
15 changes: 15 additions & 0 deletions sitio-sveltekit/src/routes/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ export const load: PageServerLoad = async ({ url, platform, setHeaders }) => {
'cache-control': 'public, max-age=60'
});

for (const vuelo of vuelos) {
// @ts-ignore
delete vuelo.aeronave;
// @ts-ignore
delete vuelo.msn;
// @ts-ignore
delete vuelo.compania_aerea;
// @ts-ignore
delete vuelo.situacion;
// @ts-ignore
delete vuelo.detail_url;
// @ts-ignore
delete vuelo.edad_del_avion;
}

return {
vuelos: vuelos.filter((vuelo) => vuelo.stda >= start.toDate() && vuelo.stda <= end.toDate()),
date: date.toDate(),
Expand Down

0 comments on commit 3f85cd3

Please sign in to comment.