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
20 changes: 10 additions & 10 deletions docs/api/api_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ define({
},
{
"type": "get",
"url": "/hacker/email/:email",
"url": "/hacker/:id",
"title": "get a hacker's information",
"name": "getHacker",
"group": "Hacker",
Expand All @@ -1261,8 +1261,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 @@ -1317,12 +1317,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",
"title": "get a hacker's information",
"name": "getHacker",
"group": "Hacker",
Expand All @@ -1333,8 +1333,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 @@ -1389,7 +1389,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 @@ -1628,7 +1628,7 @@ define({
{
"type": "patch",
"url": "/hacker/confirmation/:id",
"title": "Allows confirmation of hacker attendence if they are accepted. Also allows change from 'confirmed' back to 'accepted'",
"title": "Allows confirmation of hacker attendence if they are accepted. Also allows change from 'confirmed' to 'cancelled'.",
"name": "patchHackerConfirmed",
"group": "Hacker",
"version": "0.0.9",
Expand All @@ -1639,7 +1639,7 @@ define({
"type": "string",
"optional": true,
"field": "status",
"description": "<p>The new status of the hacker. &quot;Accepted&quot; or &quot;Confirmed&quot;</p>"
"description": "<p>The new status of the hacker. &quot;Accepted&quot;, &quot;Confirmed&quot;, or &quot;Cancelled&quot;</p>"
}]
}
},
Expand Down
20 changes: 10 additions & 10 deletions docs/api/api_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,7 @@
},
{
"type": "get",
"url": "/hacker/email/:email",
"url": "/hacker/:id",
"title": "get a hacker's information",
"name": "getHacker",
"group": "Hacker",
Expand All @@ -1260,8 +1260,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 @@ -1316,12 +1316,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 @@ -1332,8 +1332,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 @@ -1388,7 +1388,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 @@ -1627,7 +1627,7 @@
{
"type": "patch",
"url": "/hacker/confirmation/:id",
"title": "Allows confirmation of hacker attendence if they are accepted. Also allows change from 'confirmed' back to 'accepted'",
"title": "Allows confirmation of hacker attendence if they are accepted. Also allows change from 'confirmed' to 'cancelled'.",
"name": "patchHackerConfirmed",
"group": "Hacker",
"version": "0.0.9",
Expand All @@ -1638,7 +1638,7 @@
"type": "string",
"optional": true,
"field": "status",
"description": "<p>The new status of the hacker. &quot;Accepted&quot; or &quot;Confirmed&quot;</p>"
"description": "<p>The new status of the hacker. &quot;Accepted&quot;, &quot;Confirmed&quot;, or &quot;Cancelled&quot;</p>"
}]
}
},
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-10T23:24:21.462Z",
"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-14T00:33:25.620Z",
"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-10T23:24:21.462Z",
"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-14T00:33:25.620Z",
"url": "http://apidocjs.com",
"version": "0.17.7"
}
}
4 changes: 2 additions & 2 deletions middlewares/hacker.middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function parseCheckIn(req, res, next) {
* @param {(err?)=>void} next
* @return {void}
* @description
* Changes req.body.status to confirmed or accepted depending on whether req.body.confirm is true or false respectively.
* Changes req.body.status to confirmed or cancelled depending on whether req.body.confirm is true or false respectively.
* Deletes req.body.confirm afterwards
*/
function parseConfirmation(req, res, next) {
Expand All @@ -107,7 +107,7 @@ function parseConfirmation(req, res, next) {
if (confirm) {
req.body.status = Constants.General.HACKER_STATUS_CONFIRMED;
} else {
req.body.status = Constants.General.HACKER_STATUS_ACCEPTED;
req.body.status = Constants.General.HACKER_STATUS_CANCELLED;
}

delete req.body.confirm;
Expand Down
6 changes: 3 additions & 3 deletions routes/api/hacker.js
Original file line number Diff line number Diff line change
Expand Up @@ -550,12 +550,12 @@ module.exports = {

/**
* @api {patch} /hacker/confirmation/:id
* Allows confirmation of hacker attendence if they are accepted. Also allows change from 'confirmed' back to 'accepted'
* Allows confirmation of hacker attendence if they are accepted. Also allows change from 'confirmed' to 'cancelled'.
* @apiName patchHackerConfirmed
* @apiGroup Hacker
* @apiVersion 0.0.9
*
* @apiParam (body) {string} [status] The new status of the hacker. "Accepted" or "Confirmed"
* @apiParam (body) {string} [status] The new status of the hacker. "Accepted", "Confirmed", or "Cancelled"
* @apiSuccess {string} message Success message
* @apiSuccess {object} data Hacker object
* @apiSuccessExample {object} Success-Response:
Expand All @@ -577,7 +577,7 @@ module.exports = {
Middleware.parseBody.middleware,
Middleware.Hacker.parsePatch,

Middleware.Hacker.checkStatus([CONSTANTS.HACKER_STATUS_ACCEPTED, CONSTANTS.HACKER_STATUS_CONFIRMED]),
Middleware.Hacker.checkStatus([CONSTANTS.HACKER_STATUS_ACCEPTED, CONSTANTS.HACKER_STATUS_CONFIRMED, CONSTANTS.HACKER_STATUS_CANCELLED]),

Middleware.Hacker.parseConfirmation,
Middleware.Hacker.updateHacker,
Expand Down
2 changes: 1 addition & 1 deletion tests/hacker.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ describe("PATCH update one hacker", function () {
res.body.message.should.equal(Constants.Success.HACKER_UPDATE);
res.body.should.have.property("data");
chai.assert.equal(JSON.stringify(res.body.data), JSON.stringify({
status: Constants.General.HACKER_STATUS_ACCEPTED
status: Constants.General.HACKER_STATUS_CANCELLED
}));

done();
Expand Down