@@ -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 */
457455function 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 ;
0 commit comments