Skip to content

Commit c2c6c88

Browse files
committed
Remove input to resume link in create / patch
1 parent 1b5ead0 commit c2c6c88

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

middlewares/validators/validator.helper.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,6 @@ function applicationValidator(fieldLocation, fieldname, optional = true) {
345345
checkFalsy: true
346346
}).custom(app => {
347347
const jobInterests = Constants.JOB_INTERESTS;
348-
hasValid.resume = (!app.portfolioURL.resume || typeof (app.portfolioURL.resume) === "string");
349348
hasValid.github = (!app.portfolioURL.github || typeof (app.portfolioURL.github) === "string");
350349
hasValid.dropler = (!app.portfolioURL.dropler || typeof (app.portfolioURL.dropler) === "string");
351350
hasValid.personal = (!app.portfolioURL.personal || typeof (app.portfolioURL.personal) === "string");
@@ -365,7 +364,6 @@ function applicationValidator(fieldLocation, fieldname, optional = true) {
365364
} else {
366365
return application.custom(app => {
367366
const jobInterests = Constants.JOB_INTERESTS;
368-
hasValid.resume = (typeof (app.portfolioURL.resume) === "string");
369367
hasValid.github = (!app.portfolioURL.github || typeof (app.portfolioURL.github) === "string");
370368
hasValid.dropler = (!app.portfolioURL.dropler || typeof (app.portfolioURL.dropler) === "string");
371369
hasValid.personal = (!app.portfolioURL.personal || typeof (app.portfolioURL.personal) === "string");
@@ -441,7 +439,7 @@ function jwtValidator(fieldLocation, fieldname, jwtSecret, optional = true) {
441439
* @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found
442440
* @param {string} fieldname name of the field that needs to be validated.
443441
*/
444-
function searchModelValidator(fieldLocation, fieldName){
442+
function searchModelValidator(fieldLocation, fieldName) {
445443
const paramChain = setProperValidationChainBuilder(fieldLocation, fieldName, "Must be a valid searchable model");
446444
return paramChain.exists().withMessage("Model must be provided")
447445
.isLowercase().withMessage("Model must be lower case")
@@ -456,9 +454,11 @@ function searchModelValidator(fieldLocation, fieldName){
456454
*/
457455
function searchValidator(fieldLocation, fieldname) {
458456
const search = setProperValidationChainBuilder(fieldLocation, fieldname, "Invalid search query");
459-
457+
460458
return search.exists().withMessage("Search query must be provided")
461-
.custom((value, {req}) => {
459+
.custom((value, {
460+
req
461+
}) => {
462462
//value is a serialized JSON
463463
value = JSON.parse(value);
464464
let modelString = req.params.model
@@ -506,7 +506,9 @@ function searchSortValidator(fieldLocation, fieldName) {
506506
return searchSort.optional({
507507
checkFalsy: true
508508
})
509-
.custom((value, {req}) => {
509+
.custom((value, {
510+
req
511+
}) => {
510512
let modelString = req.params.model
511513
if (modelString.equals("hacker")) {
512514
model = Models.Hacker;

models/hacker.model.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const HackerSchema = new mongoose.Schema({
3434
//gcloud bucket link
3535
resume: {
3636
type: String,
37+
default: ""
3738
},
3839
github: {
3940
type: String
@@ -118,10 +119,9 @@ HackerSchema.methods.isApplicationComplete = function () {
118119
*/
119120
HackerSchema.statics.searchableField = function (field) {
120121
const schemaField = HackerSchema.path(field)
121-
if(schemaField != undefined){
122+
if (schemaField != undefined) {
122123
return schemaField.instance
123-
}
124-
else{
124+
} else {
125125
return null;
126126
}
127127
};

routes/api/hacker.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ module.exports = {
6969
* @apiParamExample {Json} application:
7070
* {
7171
* "portfolioURL": {
72-
* "resume": "..."
7372
* "github": "...",
7473
* "dropler": "...",
7574
* "personal": "...",
@@ -194,7 +193,6 @@ module.exports = {
194193
* @apiParamExample {Json} application:
195194
* {
196195
* "portfolioURL": {
197-
* "resume": "..."
198196
* "github": "...",
199197
* "dropler": "...",
200198
* "personal": "...",

0 commit comments

Comments
 (0)