Remove promise.all implementation
This commit is contained in:
parent
e2f033aea1
commit
37bf2d4e6d
|
@ -112,33 +112,6 @@ export async function getUpcomingEvents(): Promise<Event[]> {
|
|||
}
|
||||
|
||||
export async function getAllEvents() {
|
||||
/* Promise.all implementation
|
||||
const slugs = (
|
||||
await Promise.all(
|
||||
(
|
||||
await getEventYears()
|
||||
).map(
|
||||
async (year) =>
|
||||
await Promise.all(
|
||||
(
|
||||
await getEventTermsByYear(year)
|
||||
).map(async (term) => {
|
||||
return (await getEventsByTerm(year, term)).map((slug) => ({
|
||||
slug,
|
||||
term,
|
||||
year,
|
||||
}));
|
||||
})
|
||||
)
|
||||
)
|
||||
)
|
||||
).flat(2);
|
||||
|
||||
return await Promise.all(
|
||||
slugs.map(({ year, term, slug }) => getEventBySlug(year, term, slug))
|
||||
);
|
||||
*/
|
||||
|
||||
const events: Event[] = [];
|
||||
|
||||
for (const year of await getEventYears()) {
|
||||
|
|
Loading…
Reference in New Issue