Create members.json api #489
Merged
a3thakra
merged 8 commits from adi-member-json-api
into main
6 months ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'adi-member-json-api'
Deleting a branch is permanent. It CANNOT be undone. Continue?
I changed some other code along the way ... which makes this PR slightly long :') rip.
closes #472
takes a stab at #466
https://csclub.uwaterloo.ca/~a3thakra/csc/adi-member-json-api/api/members.json
e0528681c1
to6eb8d4d064
6 months agoLooks good overall, thanks for working on this Adi! Though next time please split unrelated changes into separate PRs. 😆
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
Dropping this here for personal reference: https://json-schema.org/
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Member list",
"description": "List of all members of the Computer Science Club of the University of Waterloo",
NIT: List of all current members
fixed!
members,
};
await writeFile("public/api/members.json", JSON.stringify(result));
Just wanted to note, I think NextJS has some kind of API Routing thing which maps files in
pages/api
to/api/*
- I wonder how that would interact with us hosting a static file like this at/api/*
?(This probably isn't relevant though, as we are aiming to keep the site static so there's no reason to be using the API Routing shenanigans.)
https://nextjs.org/docs/api-routes/introduction
yep, that one is only for a non-static website.
I think it's okay for now, even if we add nextjs api later on, it should still work.
/*
Note:
This script will not work for events by default anymore, since events now have startDate instead of endDate
NIT: is this the best location in the file for this comment? Not sure if it should go right at the top, or right above the main function, or if this is fine. 🤔
Since the script doesn't work, i decided to delete it. I don't think we'll be needing this. Even if we do it's fairly easy to rewrite :P
skipCurrent?: boolean;
}
export function* getTermYear(
This is very cool, did not know it was a thing 👀
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*
whoopsie got a little carried away :'(
be308f6249
into main 6 months agoReviewers
be308f6249
.