Compare commits
2 Commits
9263fdd10a
...
2cbba93d9d
Author | SHA1 | Date |
---|---|---|
Aditya Thakral | 2cbba93d9d | |
Aditya Thakral | c14455fe14 |
|
@ -30,5 +30,6 @@ yarn-error.log*
|
||||||
# Images should be optimized
|
# Images should be optimized
|
||||||
/public/images
|
/public/images
|
||||||
|
|
||||||
# APIs should be automatically generated
|
# APIs should be automatically generated, schema should be checked in
|
||||||
/public/api
|
/public/api/*
|
||||||
|
!/public/api/schema
|
|
@ -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",
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"members": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"program": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,7 +7,13 @@ async function createMembersApi() {
|
||||||
const { term, year } = getCurrentTermYear();
|
const { term, year } = getCurrentTermYear();
|
||||||
const members = await getMembers(year, term);
|
const members = await getMembers(year, term);
|
||||||
|
|
||||||
await writeFile("public/api/members.json", JSON.stringify(members));
|
const result = {
|
||||||
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
$id: "schema/members.json",
|
||||||
|
members,
|
||||||
|
};
|
||||||
|
|
||||||
|
await writeFile("public/api/members.json", JSON.stringify(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
void createMembersApi();
|
void createMembersApi();
|
||||||
|
|
Loading…
Reference in New Issue