Merge branch 'feat/events-lib' into feat/events-year

This commit is contained in:
Jared He 2021-08-17 13:53:09 -05:00
commit 7afb956009
1 changed files with 2 additions and 2 deletions

View File

@ -8,14 +8,14 @@ import { serialize } from "next-mdx-remote/serialize";
const EVENTS_PATH = path.join("content", "events");
const TERMS = ["winter", "spring", "fall"];
export async function getYears(): Promise<string[]> {
export async function getEventYears(): Promise<string[]> {
return (await fs.readdir(EVENTS_PATH, { withFileTypes: true }))
.filter((dirent) => dirent.isDirectory())
.map((dirent) => dirent.name)
.sort();
}
export async function getTermsByYear(year: string): Promise<string[]> {
export async function getEventTermsByYear(year: string): Promise<string[]> {
return (
await fs.readdir(path.join(EVENTS_PATH, year), { withFileTypes: true })
)