|
|
|
@ -44,25 +44,23 @@ export const getStaticProps: GetStaticProps<Props, Params> = async ( |
|
|
|
|
|
|
|
|
|
export const getStaticPaths: GetStaticPaths<Params> = async () => { |
|
|
|
|
const years = await getEventYears(); |
|
|
|
|
const terms = ( |
|
|
|
|
const events = ( |
|
|
|
|
await Promise.all( |
|
|
|
|
years.map(async (year) => { |
|
|
|
|
const termsInYear = await getEventTermsByYear(year); |
|
|
|
|
return termsInYear.map((term) => ({ year, term })); |
|
|
|
|
}) |
|
|
|
|
) |
|
|
|
|
).flat(); |
|
|
|
|
const events = ( |
|
|
|
|
await Promise.all( |
|
|
|
|
terms.map(async (term) => { |
|
|
|
|
const eventsInTerm = await getEventsByTerm(term.year, term.term); |
|
|
|
|
return eventsInTerm.map((event) => ({ |
|
|
|
|
...term, |
|
|
|
|
event, |
|
|
|
|
})); |
|
|
|
|
return await Promise.all( |
|
|
|
|
termsInYear.map(async (term) => { |
|
|
|
|
const eventsInTerm = await getEventsByTerm(year, term); |
|
|
|
|
return eventsInTerm.map((event) => ({ |
|
|
|
|
year, |
|
|
|
|
term, |
|
|
|
|
event, |
|
|
|
|
})); |
|
|
|
|
}) |
|
|
|
|
); |
|
|
|
|
}) |
|
|
|
|
) |
|
|
|
|
).flat(); |
|
|
|
|
).flat(2); |
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
paths: events.map((params) => ({ params })), |
|
|
|
|