diff --git a/docs/api/api_data.js b/docs/api/api_data.js index a97ad474..ee4a109b 100644 --- a/docs/api/api_data.js +++ b/docs/api/api_data.js @@ -1423,6 +1423,27 @@ define({ "field": "needsBus", "description": "

Whether the hacker requires a bus for transportation

" }, + { + "group": "body", + "type": "String[]", + "optional": true, + "field": "ethnicity", + "description": "

the ethnicities of the hacker

" + }, + { + "group": "body", + "type": "String", + "optional": true, + "field": "major", + "description": "

the major of the hacker

" + }, + { + "group": "body", + "type": "Number", + "optional": true, + "field": "graduationYear", + "description": "

the graduation year of the hacker

" + }, { "group": "body", "type": "Json", diff --git a/docs/api/api_data.json b/docs/api/api_data.json index f8f3bd8d..716bc782 100644 --- a/docs/api/api_data.json +++ b/docs/api/api_data.json @@ -1422,6 +1422,27 @@ "field": "needsBus", "description": "

Whether the hacker requires a bus for transportation

" }, + { + "group": "body", + "type": "String[]", + "optional": true, + "field": "ethnicity", + "description": "

the ethnicities of the hacker

" + }, + { + "group": "body", + "type": "String", + "optional": true, + "field": "major", + "description": "

the major of the hacker

" + }, + { + "group": "body", + "type": "Number", + "optional": true, + "field": "graduationYear", + "description": "

the graduation year of the hacker

" + }, { "group": "body", "type": "Json", diff --git a/docs/api/api_project.js b/docs/api/api_project.js index 8a9d4278..943e5b3e 100644 --- a/docs/api/api_project.js +++ b/docs/api/api_project.js @@ -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" + } }); \ No newline at end of file diff --git a/docs/api/api_project.json b/docs/api/api_project.json index c48c81ab..08ac760c 100644 --- a/docs/api/api_project.json +++ b/docs/api/api_project.json @@ -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" + } } \ No newline at end of file diff --git a/docs/api/locales/locale.js b/docs/api/locales/locale.js index c7f34916..880a96cf 100644 --- a/docs/api/locales/locale.js +++ b/docs/api/locales/locale.js @@ -1,5 +1,6 @@ define([ './locales/ca.js', + './locales/cs.js', './locales/de.js', './locales/es.js', './locales/fr.js', diff --git a/middlewares/validators/hacker.validator.js b/middlewares/validators/hacker.validator.js index 6d2e45eb..2b98e8d4 100644 --- a/middlewares/validators/hacker.validator.js +++ b/middlewares/validators/hacker.validator.js @@ -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), diff --git a/routes/api/hacker.js b/routes/api/hacker.js index 04a4250d..efef35cb 100644 --- a/routes/api/hacker.js +++ b/routes/api/hacker.js @@ -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: * {