Create members.json api #489

Merged
a3thakra merged 8 commits from adi-member-json-api into main 2022-08-08 04:31:17 -04:00
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 force-pushed adi-member-json-api from e0528681c1 to 6eb8d4d064 2022-08-07 20:06:37 -04:00 Compare
a3thakra added 1 commit 2022-08-07 20:08:28 -04:00
continuous-integration/drone/push Build is passing Details
9263fdd10a
Add build:api to build
a3thakra added 2 commits 2022-08-07 20:37:56 -04:00
continuous-integration/drone/push Build is passing Details
2cbba93d9d
Add json schema
a258wang approved these changes 2022-08-08 03:19:36 -04:00
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. 😆
@ -0,0 +1,25 @@
{
"$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
@ -0,0 +1,25 @@
{
"$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
Author
Owner

fixed!

fixed!
a3thakra marked this conversation as resolved
@ -0,0 +13,4 @@
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
Author
Owner

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

yep, that one is only for a non-static website.
Author
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
@ -23,0 +18,4 @@
/*
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. 🤔
Author
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
@ -24,0 +32,4 @@
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 2022-08-08 04:05:31 -04:00
continuous-integration/drone/push Build is passing Details
eacb858faa
Fix comments
Author
Owner

whoopsie got a little carried away :'(

whoopsie got a little carried away :'(
a3thakra added 1 commit 2022-08-08 04:19:40 -04:00
continuous-integration/drone/push Build is passing Details
ec8b766aba
fix scenario when goBackwards is true + start is a number
a3thakra merged commit be308f6249 into main 2022-08-08 04:31:17 -04:00
a3thakra deleted branch adi-member-json-api 2022-08-08 04:31:23 -04:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: www/www-new#489
No description provided.