Create members.json api #489

Merged
a3thakra merged 8 commits from adi-member-json-api into main 2 months ago
Owner

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

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
a3thakra added 3 commits 2 months ago
5b32153613 Create members api
e0528681c1 Simplify teams page
a3thakra force-pushed adi-member-json-api from e0528681c1 to 6eb8d4d064 2 months ago
a3thakra added 1 commit 2 months ago
9263fdd10a Add build:api to build
a3thakra added 2 commits 2 months ago
2cbba93d9d Add json schema
a258wang approved these changes 2 months ago
a258wang left a comment
Owner

Looks good overall, thanks for working on this Adi! Though next time please split unrelated changes into separate PRs. 😆

Looks 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",
Owner

Dropping this here for personal reference: https://json-schema.org/

Dropping this here for personal reference: https://json-schema.org/
a3thakra marked this conversation as resolved
{
"$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",
Owner

NIT: List of all current members

NIT: List of all **current** members
Poster
Owner

fixed!

fixed!
a3thakra marked this conversation as resolved
members,
};
await writeFile("public/api/members.json", JSON.stringify(result));
Owner

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

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
Poster
Owner

yep, that one is only for a non-static website.

yep, that one is only for a non-static website.
Poster
Owner

I think it's okay for now, even if we add nextjs api later on, it should still work.

I think it's okay for now, even if we add nextjs api later on, it should still work.
a3thakra marked this conversation as resolved
/*
Note:
This script will not work for events by default anymore, since events now have startDate instead of endDate
Owner

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. 🤔

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. 🤔
Poster
Owner

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

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
a3thakra marked this conversation as resolved
skipCurrent?: boolean;
}
export function* getTermYear(
Owner
This is very cool, did not know it was a thing 👀 https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*
a3thakra marked this conversation as resolved
a3thakra added 1 commit 2 months ago
eacb858faa Fix comments
Poster
Owner

whoopsie got a little carried away :'(

whoopsie got a little carried away :'(
a3thakra added 1 commit 2 months ago
a3thakra merged commit be308f6249 into main 2 months ago
a3thakra referenced this issue from a commit 2 months ago
a3thakra deleted branch adi-member-json-api 2 months ago

Reviewers

a258wang approved these changes 2 months ago
continuous-integration/drone/push Build is passing
The pull request has been merged as be308f6249.
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: www/www-new#489
Loading…
There is no content yet.