Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion controllers/team.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const Constants = {
*/
function showTeam(req, res) {
const teamData = req.body.team.toJSON();
delete teamData.members;

const memberNames = [];
for (const member of req.body.teamMembers) {
Expand Down
18 changes: 9 additions & 9 deletions docs/api/api_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,7 @@ define({
},
{
"type": "get",
"url": "/hacker/email/:email",
"url": "/hacker/:id",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused as to where these changes are coming from. Was this from a previous PR where docs wasn't updated?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no idea, probably just ordering of the items in the list

"title": "get a hacker's information",
"name": "getHacker",
"group": "Hacker",
Expand All @@ -1268,8 +1268,8 @@ define({
"group": "param",
"type": "String",
"optional": false,
"field": "email",
"description": "<p>a hacker's unique email</p>"
"field": "id",
"description": "<p>a hacker's unique mongoID</p>"
}]
}
},
Expand Down Expand Up @@ -1324,12 +1324,12 @@ define({
"filename": "routes/api/hacker.js",
"groupTitle": "Hacker",
"sampleRequest": [{
"url": "https://api.mchacks.ca/api/hacker/email/:email"
"url": "https://api.mchacks.ca/api/hacker/:id"
}]
},
{
"type": "get",
"url": "/hacker/:id",
"url": "/hacker/email/:email",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's also kind of weird that in some cases we remove :id to add email/:email, and above we removed email/:email to add :id

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment above

"title": "get a hacker's information",
"name": "getHacker",
"group": "Hacker",
Expand All @@ -1340,8 +1340,8 @@ define({
"group": "param",
"type": "String",
"optional": false,
"field": "id",
"description": "<p>a hacker's unique mongoID</p>"
"field": "email",
"description": "<p>a hacker's unique email</p>"
}]
}
},
Expand Down Expand Up @@ -1396,7 +1396,7 @@ define({
"filename": "routes/api/hacker.js",
"groupTitle": "Hacker",
"sampleRequest": [{
"url": "https://api.mchacks.ca/api/hacker/:id"
"url": "https://api.mchacks.ca/api/hacker/email/:email"
}]
},
{
Expand Down Expand Up @@ -2645,7 +2645,7 @@ define({
},
"examples": [{
"title": "Success-Response: ",
"content": "{\n \"message\": \"Successfully retrieved team information\", \n \"data\": {...}\n }",
"content": "{\n \"message\": \"Team retrieval successful\", \n \"data\": { \n \"team\": {\n \"name\":\"foo\",\n \"members\": [\n ObjectId('...')\n ],\n \"devpostURL\": \"www.devpost.com/foo\",\n \"projectName\": \"fooey\"\n },\n \"members\": [\n {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\"\n }\n ],\n }\n }",
"type": "object"
}]
},
Expand Down
18 changes: 9 additions & 9 deletions docs/api/api_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,7 @@
},
{
"type": "get",
"url": "/hacker/email/:email",
"url": "/hacker/:id",
"title": "get a hacker's information",
"name": "getHacker",
"group": "Hacker",
Expand All @@ -1267,8 +1267,8 @@
"group": "param",
"type": "String",
"optional": false,
"field": "email",
"description": "<p>a hacker's unique email</p>"
"field": "id",
"description": "<p>a hacker's unique mongoID</p>"
}]
}
},
Expand Down Expand Up @@ -1323,12 +1323,12 @@
"filename": "routes/api/hacker.js",
"groupTitle": "Hacker",
"sampleRequest": [{
"url": "https://api.mchacks.ca/api/hacker/email/:email"
"url": "https://api.mchacks.ca/api/hacker/:id"
}]
},
{
"type": "get",
"url": "/hacker/:id",
"url": "/hacker/email/:email",
"title": "get a hacker's information",
"name": "getHacker",
"group": "Hacker",
Expand All @@ -1339,8 +1339,8 @@
"group": "param",
"type": "String",
"optional": false,
"field": "id",
"description": "<p>a hacker's unique mongoID</p>"
"field": "email",
"description": "<p>a hacker's unique email</p>"
}]
}
},
Expand Down Expand Up @@ -1395,7 +1395,7 @@
"filename": "routes/api/hacker.js",
"groupTitle": "Hacker",
"sampleRequest": [{
"url": "https://api.mchacks.ca/api/hacker/:id"
"url": "https://api.mchacks.ca/api/hacker/email/:email"
}]
},
{
Expand Down Expand Up @@ -2643,7 +2643,7 @@
},
"examples": [{
"title": "Success-Response: ",
"content": "{\n \"message\": \"Successfully retrieved team information\", \n \"data\": {...}\n }",
"content": "{\n \"message\": \"Team retrieval successful\", \n \"data\": { \n \"team\": {\n \"name\":\"foo\",\n \"members\": [\n ObjectId('...')\n ],\n \"devpostURL\": \"www.devpost.com/foo\",\n \"projectName\": \"fooey\"\n },\n \"members\": [\n {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\"\n }\n ],\n }\n }",
"type": "object"
}]
},
Expand Down
30 changes: 15 additions & 15 deletions docs/api/api_project.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
define({
"name": "hackerAPI",
"version": "0.0.8",
"description": "Documentation for the API used for mchacks",
"defaultVersion": "0.0.8",
"title": "hackerAPI documentation",
"url": "https://api.mchacks.ca/api",
"sampleUrl": "https://api.mchacks.ca/api",
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
"time": "2019-01-21T04:13:36.482Z",
"url": "http://apidocjs.com",
"version": "0.17.7"
}
define({
"name": "hackerAPI",
"version": "0.0.8",
"description": "Documentation for the API used for mchacks",
"defaultVersion": "0.0.8",
"title": "hackerAPI documentation",
"url": "https://api.mchacks.ca/api",
"sampleUrl": "https://api.mchacks.ca/api",
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
"time": "2019-01-21T04:13:36.482Z",
"url": "http://apidocjs.com",
"version": "0.17.7"
}
});
30 changes: 15 additions & 15 deletions docs/api/api_project.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "hackerAPI",
"version": "0.0.8",
"description": "Documentation for the API used for mchacks",
"defaultVersion": "0.0.8",
"title": "hackerAPI documentation",
"url": "https://api.mchacks.ca/api",
"sampleUrl": "https://api.mchacks.ca/api",
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
"time": "2019-01-21T04:13:36.482Z",
"url": "http://apidocjs.com",
"version": "0.17.7"
}
{
"name": "hackerAPI",
"version": "0.0.8",
"description": "Documentation for the API used for mchacks",
"defaultVersion": "0.0.8",
"title": "hackerAPI documentation",
"url": "https://api.mchacks.ca/api",
"sampleUrl": "https://api.mchacks.ca/api",
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
"time": "2019-01-21T04:13:36.482Z",
"url": "http://apidocjs.com",
"version": "0.17.7"
}
}
5 changes: 3 additions & 2 deletions middlewares/team.middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,13 +407,14 @@ async function populateMemberAccountsById(req, res, next) {
data: {}
});
}

let hackerIds = [];
let teamMembers = [];

for (const member of team.members) {
teamMembers.push(member.accountId);
hackerIds.push(member._id);
}

team.members = hackerIds;
req.body.team = team;
req.body.teamMembers = teamMembers;
return next();
Expand Down
Loading