@@ -328,7 +328,6 @@ function applicationValidator(fieldLocation, fieldname, optional = true) {
328328
329329 //helper object to iterate through the items in the application and track which items are not valid.
330330 const hasValid = {
331- resume : false ,
332331 github : false ,
333332 dropler : false ,
334333 personal : false ,
@@ -345,7 +344,6 @@ function applicationValidator(fieldLocation, fieldname, optional = true) {
345344 checkFalsy : true
346345 } ) . custom ( app => {
347346 const jobInterests = Constants . JOB_INTERESTS ;
348- hasValid . resume = ( ! app . portfolioURL . resume || typeof ( app . portfolioURL . resume ) === "string" ) ;
349347 hasValid . github = ( ! app . portfolioURL . github || typeof ( app . portfolioURL . github ) === "string" ) ;
350348 hasValid . dropler = ( ! app . portfolioURL . dropler || typeof ( app . portfolioURL . dropler ) === "string" ) ;
351349 hasValid . personal = ( ! app . portfolioURL . personal || typeof ( app . portfolioURL . personal ) === "string" ) ;
@@ -365,7 +363,6 @@ function applicationValidator(fieldLocation, fieldname, optional = true) {
365363 } else {
366364 return application . custom ( app => {
367365 const jobInterests = Constants . JOB_INTERESTS ;
368- hasValid . resume = ( typeof ( app . portfolioURL . resume ) === "string" ) ;
369366 hasValid . github = ( ! app . portfolioURL . github || typeof ( app . portfolioURL . github ) === "string" ) ;
370367 hasValid . dropler = ( ! app . portfolioURL . dropler || typeof ( app . portfolioURL . dropler ) === "string" ) ;
371368 hasValid . personal = ( ! app . portfolioURL . personal || typeof ( app . portfolioURL . personal ) === "string" ) ;
@@ -441,7 +438,7 @@ function jwtValidator(fieldLocation, fieldname, jwtSecret, optional = true) {
441438 * @param {"query" | "body" | "header" | "param" } fieldLocation the location where the field should be found
442439 * @param {string } fieldname name of the field that needs to be validated.
443440 */
444- function searchModelValidator ( fieldLocation , fieldName ) {
441+ function searchModelValidator ( fieldLocation , fieldName ) {
445442 const paramChain = setProperValidationChainBuilder ( fieldLocation , fieldName , "Must be a valid searchable model" ) ;
446443 return paramChain . exists ( ) . withMessage ( "Model must be provided" )
447444 . isLowercase ( ) . withMessage ( "Model must be lower case" )
@@ -456,9 +453,11 @@ function searchModelValidator(fieldLocation, fieldName){
456453 */
457454function searchValidator ( fieldLocation , fieldname ) {
458455 const search = setProperValidationChainBuilder ( fieldLocation , fieldname , "Invalid search query" ) ;
459-
456+
460457 return search . exists ( ) . withMessage ( "Search query must be provided" )
461- . custom ( ( value , { req} ) => {
458+ . custom ( ( value , {
459+ req
460+ } ) => {
462461 //value is a serialized JSON
463462 value = JSON . parse ( value ) ;
464463 let modelString = req . params . model
@@ -506,7 +505,9 @@ function searchSortValidator(fieldLocation, fieldName) {
506505 return searchSort . optional ( {
507506 checkFalsy : true
508507 } )
509- . custom ( ( value , { req} ) => {
508+ . custom ( ( value , {
509+ req
510+ } ) => {
510511 let modelString = req . params . model
511512 if ( modelString . equals ( "hacker" ) ) {
512513 model = Models . Hacker ;
0 commit comments