@@ -467,10 +467,11 @@ async function searchJobs (currentUser, criteria, options = { returnAll: false }
467
467
'title' ,
468
468
'status' ,
469
469
'minSalary' ,
470
- 'maxSalary'
470
+ 'maxSalary' ,
471
+ 'jobLocation'
471
472
] ) , ( value , key ) => {
472
473
let must
473
- if ( key === 'description' || key === 'title' ) {
474
+ if ( key === 'description' || key === 'title' || key === 'jobLocation' ) {
474
475
must = {
475
476
match : {
476
477
[ key ] : {
@@ -520,7 +521,6 @@ async function searchJobs (currentUser, criteria, options = { returnAll: false }
520
521
}
521
522
} )
522
523
}
523
- console . log ( criteria . bodySkills )
524
524
// if critera contains bodySkills, filter skills with this value
525
525
if ( criteria . bodySkills && criteria . bodySkills . length > 0 ) {
526
526
esQuery . body . query . bool . filter . push ( {
@@ -575,6 +575,11 @@ async function searchJobs (currentUser, criteria, options = { returnAll: false }
575
575
[ Op . like ] : `%${ criteria . title } %`
576
576
}
577
577
}
578
+ if ( criteria . jobLocation ) {
579
+ filter . jobLocation = {
580
+ [ Op . like ] : `%${ criteria . jobLocation } %`
581
+ }
582
+ }
578
583
if ( criteria . skill || ( criteria . bodySkills && criteria . bodySkills . length > 0 ) ) {
579
584
const skill = criteria . skill
580
585
const bodySkills = criteria . bodySkills
@@ -665,7 +670,8 @@ searchJobs.schema = Joi.object().keys({
665
670
jobIds : Joi . array ( ) . items ( Joi . string ( ) . uuid ( ) ) ,
666
671
bodySkills : Joi . array ( ) . items ( Joi . string ( ) . uuid ( ) ) ,
667
672
minSalary : Joi . number ( ) . integer ( ) ,
668
- maxSalary : Joi . number ( ) . integer ( )
673
+ maxSalary : Joi . number ( ) . integer ( ) ,
674
+ jobLocation : Joi . string ( )
669
675
} ) . required ( ) ,
670
676
options : Joi . object ( )
671
677
} ) . required ( )
0 commit comments