Skip to content

Commit 697ed46

Browse files
job Location added
1 parent d4f986f commit 697ed46

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/services/JobService.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -467,10 +467,11 @@ async function searchJobs (currentUser, criteria, options = { returnAll: false }
467467
'title',
468468
'status',
469469
'minSalary',
470-
'maxSalary'
470+
'maxSalary',
471+
'jobLocation'
471472
]), (value, key) => {
472473
let must
473-
if (key === 'description' || key === 'title') {
474+
if (key === 'description' || key === 'title' || key === 'jobLocation') {
474475
must = {
475476
match: {
476477
[key]: {
@@ -520,7 +521,6 @@ async function searchJobs (currentUser, criteria, options = { returnAll: false }
520521
}
521522
})
522523
}
523-
console.log(criteria.bodySkills)
524524
// if critera contains bodySkills, filter skills with this value
525525
if (criteria.bodySkills && criteria.bodySkills.length > 0) {
526526
esQuery.body.query.bool.filter.push({
@@ -575,6 +575,11 @@ async function searchJobs (currentUser, criteria, options = { returnAll: false }
575575
[Op.like]: `%${criteria.title}%`
576576
}
577577
}
578+
if (criteria.jobLocation) {
579+
filter.jobLocation = {
580+
[Op.like]: `%${criteria.jobLocation}%`
581+
}
582+
}
578583
if (criteria.skill || (criteria.bodySkills && criteria.bodySkills.length > 0)) {
579584
const skill = criteria.skill
580585
const bodySkills = criteria.bodySkills
@@ -665,7 +670,8 @@ searchJobs.schema = Joi.object().keys({
665670
jobIds: Joi.array().items(Joi.string().uuid()),
666671
bodySkills: Joi.array().items(Joi.string().uuid()),
667672
minSalary: Joi.number().integer(),
668-
maxSalary: Joi.number().integer()
673+
maxSalary: Joi.number().integer(),
674+
jobLocation: Joi.string()
669675
}).required(),
670676
options: Joi.object()
671677
}).required()

0 commit comments

Comments
 (0)