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
4 changes: 2 additions & 2 deletions constants/general.constant.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const SPONSOR_T5 = "SponsorT5";
// Enums (must match with frontend)
const JOB_INTERESTS = ["Internship", "Full Time", "None"];
const SHIRT_SIZES = ["XS", "S", "M", "L", "XL", "XXL"];
const HACKATHONS_COUNT = ["0", "1", "2", "3", "4", "5+"];
const PREVIOUS_HACKATHONS = [0, 1, 2, 3, 4, 5];

const ROLE_CATEGORIES = {
SELF: ":self",
Expand Down Expand Up @@ -190,7 +190,7 @@ module.exports = {
REQUEST_TYPES: REQUEST_TYPES,
JOB_INTERESTS: JOB_INTERESTS,
SHIRT_SIZES: SHIRT_SIZES,
HACKATHONS_COUNT: HACKATHONS_COUNT,
PREVIOUS_HACKATHONS: PREVIOUS_HACKATHONS,
USER_TYPES: USER_TYPES,
SPONSOR_TIERS: SPONSOR_TIERS,
EXTENDED_USER_TYPES: EXTENDED_USER_TYPES,
Expand Down
12 changes: 6 additions & 6 deletions docs/api/api_data.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/api/api_data.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions middlewares/validators/hacker.validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ module.exports = {
VALIDATOR.enumValidator(
"body",
"application.shortAnswer.previousHackathons",
Constants.HACKATHONS_COUNT,
Constants.PREVIOUS_HACKATHONS,
false
),

Expand Down Expand Up @@ -225,7 +225,7 @@ module.exports = {
VALIDATOR.enumValidator(
"body",
"application.shortAnswer.previousHackathons",
Constants.HACKATHONS_COUNT,
Constants.PREVIOUS_HACKATHONS,
false
),

Expand Down
4 changes: 2 additions & 2 deletions middlewares/validators/validator.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ function applicationValidator(fieldLocation, fieldname, optional = true) {
// typeof app.shortAnswer.question2 === "string";
// hasValid.previousHackathons =
// !!app.shortAnswer.previousHackathons &&
// typeof app.shortAnswer.previousHackathons === "string";
// typeof app.shortAnswer.previousHackathons === "number";
// hasValid.team =
// !app.team || mongoose.Types.ObjectId.isValid(app.team);

Expand Down Expand Up @@ -584,7 +584,7 @@ function applicationValidator(fieldLocation, fieldname, optional = true) {
// typeof app.shortAnswer.question2 === "string";
// hasValid.previousHackathons =
// !!app.shortAnswer.previousHackathons &&
// typeof app.shortAnswer.previousHackathons === "string";
// typeof app.shortAnswer.previousHackathons === "number";
// hasValid.team =
// !app.team || mongoose.Types.ObjectId.isValid(app.team);
return (
Expand Down
4 changes: 2 additions & 2 deletions models/hacker.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ const HackerSchema = new mongoose.Schema({
required: true
},
previousHackathons: {
type: String,
enum: Constants.HACKATHONS_COUNT,
type: Number,
enum: Constants.PREVIOUS_HACKATHONS,
required: true
}
},
Expand Down
12 changes: 6 additions & 6 deletions routes/api/hacker.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ module.exports = {
"skills":["Javascript","Typescript"],
"question1": "I love McHacks",
"question2":"Pls accept me",
"previousHackathons": "5+",
"previousHackathons": "5",
"comments":"hi!",
},
"other:" {
Expand Down Expand Up @@ -159,7 +159,7 @@ module.exports = {
"skills":["Javascript","Typescript"],
"question1": "I love McHacks",
"question2":"Pls accept me",
"previousHackathons": "5+",
"previousHackathons": "5",
"comments":"hi!",
},
"other:" {
Expand Down Expand Up @@ -449,7 +449,7 @@ module.exports = {
"skills":["Javascript","Typescript"],
"question1": "I love McHacks",
"question2":"Pls accept me",
"previousHackathons": "5+",
"previousHackathons": "5",
"comments":"hi!",
},
"other:" {
Expand Down Expand Up @@ -492,7 +492,7 @@ module.exports = {
"skills":["Javascript","Typescript"],
"question1": "I love McHacks",
"question2":"Pls accept me",
"previousHackathons": "5+",
"previousHackathons": "5",
"comments":"hi!",
},
"other:" {
Expand Down Expand Up @@ -564,7 +564,7 @@ module.exports = {
"skills":["Javascript","Typescript"],
"question1": "I love McHacks",
"question2":"Pls accept me",
"previousHackathons": "5+",
"previousHackathons": "5",
"comments":"hi!",
},
"other:" {
Expand Down Expand Up @@ -632,7 +632,7 @@ module.exports = {
"skills":["Javascript","Typescript"],
"question1": "I love McHacks",
"question2":"Pls accept me",
"previousHackathons": "5+",
"previousHackathons": "5",
"comments":"hi!",
},
"other:" {
Expand Down
30 changes: 15 additions & 15 deletions tests/util/hacker.test.util.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const TeamHacker0 = {
skills: ["CSS", "HTML", "JS"],
question1: "a",
question2: "a",
previousHackathons: "1"
previousHackathons: 1
},
other: {
ethnicity: ["Native American"],
Expand Down Expand Up @@ -76,7 +76,7 @@ const TeamHacker1 = {
skills: ["CSS", "HTML", "JS"],
question1: "a",
question2: "a",
previousHackathons: "2"
previousHackathons: 2
},
other: {
ethnicity: ["European"],
Expand Down Expand Up @@ -117,7 +117,7 @@ const TeamHacker2 = {
skills: ["CSS", "HTML", "JS"],
question1: "a",
question2: "a",
previousHackathons: "3"
previousHackathons: 3
},
other: {
ethnicity: ["European"],
Expand Down Expand Up @@ -158,7 +158,7 @@ const TeamHacker3 = {
skills: ["CSS", "HTML", "JS"],
question1: "a",
question2: "a",
previousHackathons: "4"
previousHackathons: 4
},
other: {
ethnicity: ["European"],
Expand Down Expand Up @@ -199,7 +199,7 @@ const TeamHacker4 = {
skills: ["CSS", "HTML", "JS"],
question1: "a",
question2: "a",
previousHackathons: "5+"
previousHackathons: 5
},
other: {
ethnicity: ["European"],
Expand Down Expand Up @@ -240,7 +240,7 @@ const NoTeamHacker0 = {
skills: ["CSS", "HTML", "JS"],
question1: "a",
question2: "a",
previousHackathons: "1"
previousHackathons: 1
},
other: {
ethnicity: ["European"],
Expand Down Expand Up @@ -278,7 +278,7 @@ const newHacker0 = {
skills: ["CSS", "HTML", "JS"],
question1: "a",
question2: "a",
previousHackathons: "2"
previousHackathons: 2
},
other: {
ethnicity: ["Caucasian"],
Expand Down Expand Up @@ -316,7 +316,7 @@ const newHacker1 = {
skills: ["CSS", "HTML", "JS"],
question1: "a",
question2: "a",
previousHackathons: "3"
previousHackathons: 3
},
other: {
ethnicity: ["African American"],
Expand Down Expand Up @@ -355,7 +355,7 @@ const invalidHacker0 = {
skills: ["CSS", "HTML", "JS"],
question1: "a",
question2: "a",
previousHackathons: "4"
previousHackathons: 4
},
other: {
ethnicity: ["Caucasian"],
Expand Down Expand Up @@ -391,7 +391,7 @@ const invalidHacker1 = {
skills: ["CSS", "HTML", "JS"],
question1: "a",
question2: "a",
previousHackathons: "5+"
previousHackathons: 5
},
other: {
ethnicity: ["Caucasian"],
Expand Down Expand Up @@ -430,7 +430,7 @@ const invalidHacker2 = {
skills: ["CSS", "HTML", "JS"],
question1: "a",
question2: "a",
previousHackathons: "1"
previousHackathons: 1
},
other: {
ethnicity: ["Caucasian"],
Expand Down Expand Up @@ -471,7 +471,7 @@ const duplicateAccountLinkHacker0 = {
skills: ["CSS", "HTML", "JS"],
question1: "a",
question2: "a",
previousHackathons: "2"
previousHackathons: 2
},
other: {
ethnicity: ["Caucasian"],
Expand Down Expand Up @@ -511,7 +511,7 @@ const waitlistedHacker0 = {
skills: ["CSS", "HTML", "JS"],
question1: "a",
question2: "a",
previousHackathons: "3"
previousHackathons: 3
},
other: {
ethnicity: ["European"],
Expand Down Expand Up @@ -552,7 +552,7 @@ const unconfirmedAccountHacker0 = {
skills: ["CSS", "HTML", "JS"],
question1: "a",
question2: "a",
previousHackathons: "4"
previousHackathons: 4
},
other: {
ethnicity: ["European"],
Expand Down Expand Up @@ -592,7 +592,7 @@ const unconfirmedAccountHacker1 = {
skills: ["CSS", "HTML", "JS"],
question1: "a",
question2: "a",
previousHackathons: "5+"
previousHackathons: 5
},
other: {
ethnicity: ["European"],
Expand Down