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
21 changes: 21 additions & 0 deletions docs/api/api_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -1423,6 +1423,27 @@ define({
"field": "needsBus",
"description": "<p>Whether the hacker requires a bus for transportation</p>"
},
{
"group": "body",
"type": "String[]",
"optional": true,
"field": "ethnicity",
"description": "<p>the ethnicities of the hacker</p>"
},
{
"group": "body",
"type": "String",
"optional": true,
"field": "major",
"description": "<p>the major of the hacker</p>"
},
{
"group": "body",
"type": "Number",
"optional": true,
"field": "graduationYear",
"description": "<p>the graduation year of the hacker</p>"
},
{
"group": "body",
"type": "Json",
Expand Down
21 changes: 21 additions & 0 deletions docs/api/api_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -1422,6 +1422,27 @@
"field": "needsBus",
"description": "<p>Whether the hacker requires a bus for transportation</p>"
},
{
"group": "body",
"type": "String[]",
"optional": true,
"field": "ethnicity",
"description": "<p>the ethnicities of the hacker</p>"
},
{
"group": "body",
"type": "String",
"optional": true,
"field": "major",
"description": "<p>the major of the hacker</p>"
},
{
"group": "body",
"type": "Number",
"optional": true,
"field": "graduationYear",
"description": "<p>the graduation year of the hacker</p>"
},
{
"group": "body",
"type": "Json",
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-04T16:52:33.543Z",
"url": "http://apidocjs.com",
"version": "0.17.6"
}
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-04T19:05:11.619Z",
"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-04T16:52:33.543Z",
"url": "http://apidocjs.com",
"version": "0.17.6"
}
{
"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-04T19:05:11.619Z",
"url": "http://apidocjs.com",
"version": "0.17.7"
}
}
1 change: 1 addition & 0 deletions docs/api/locales/locale.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
define([
'./locales/ca.js',
'./locales/cs.js',
'./locales/de.js',
'./locales/es.js',
'./locales/fr.js',
Expand Down
6 changes: 4 additions & 2 deletions middlewares/validators/hacker.validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ module.exports = {
VALIDATOR.booleanValidator("body", "confirm", false),
],

// untested
updateHackerValidator: [
VALIDATOR.asciiValidator("body", "school", true),
VALIDATOR.asciiValidator("body", "degree", true),
VALIDATOR.asciiValidator("body", "gender", true),
VALIDATOR.booleanValidator("body", "needsBus", true),
VALIDATOR.applicationValidator("body", "application", true),
VALIDATOR.booleanValidator("body", "needsBus", true)
VALIDATOR.alphaArrayValidator("body", "ethnicity", true),
VALIDATOR.asciiValidator("body", "major", true),
VALIDATOR.integerValidator("body", "graduationYear", true, 2019, 2030),
],
updateStatusValidator: [
VALIDATOR.enumValidator("body", "status", Constants.HACKER_STATUSES, false),
Expand Down
3 changes: 3 additions & 0 deletions routes/api/hacker.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@ module.exports = {
* @apiParam (body) {String} [school] Name of the school the hacker goes to
* @apiParam (body) {String} [gender] Gender of the hacker
* @apiParam (body) {Boolean} [needsBus] Whether the hacker requires a bus for transportation
* @apiParam (body) {String[]} [ethnicity] the ethnicities of the hacker
* @apiParam (body) {String} [major] the major of the hacker
* @apiParam (body) {Number} [graduationYear] the graduation year of the hacker
* @apiParam (body) {Json} [application] The hacker's application
* @apiParamExample {Json} application:
* {
Expand Down