diff --git a/pages/events/[year]/[term]/index.tsx b/pages/events/[year]/[term]/index.tsx index eaa2e71d..c62531fc 100644 --- a/pages/events/[year]/[term]/index.tsx +++ b/pages/events/[year]/[term]/index.tsx @@ -121,14 +121,16 @@ export const getStaticProps: GetStaticProps = async ( export const getStaticPaths: GetStaticPaths = async () => { const years = await getEventYears(); - const paths = []; - for (const year of years) { - const terms = await getEventTermsByYear(year); - const yearPaths = terms.map((curTerm) => ({ - params: { year: year, term: curTerm }, - })); - paths.push(...yearPaths); - } + const paths = ( + await Promise.all( + years.map(async (year) => { + const terms = await getEventTermsByYear(year); + return terms.map((curTerm) => ({ + params: { year: year, term: curTerm }, + })); + }) + ) + ).flat(); return { paths: paths,