Skip to content

Commit f5f172e

Browse files
Make the DB Query support Special param (#567)
* update:support specialJob params * update: swagger to match the API * update:swagger instruction * add db special query
1 parent a0d5740 commit f5f172e

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

data/demo-data.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
"resourceType": "Dummy Resource Type",
7979
"rateType": "hourly",
8080
"workload": "full-time",
81+
"showInHotList": true,
8182
"skills": [
8283
"23e00d92-207a-4b5b-b3c9-4c5662644941",
8384
"7d076384-ccf6-4e43-a45d-1b24b1e624aa",
@@ -110,6 +111,8 @@
110111
"resourceType": "Dummy Resource Type",
111112
"rateType": "hourly",
112113
"workload": "full-time",
114+
"showInHotList": true,
115+
"featured": true,
113116
"skills": [
114117
"23e00d92-207a-4b5b-b3c9-4c5662644941",
115118
"7d076384-ccf6-4e43-a45d-1b24b1e624aa",

src/services/JobService.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,14 @@ async function searchJobs (currentUser, criteria, options = { returnAll: false }
666666
[Op.lte]: criteria.maxSalary
667667
}
668668
}
669+
if (criteria.specialJob === true) {
670+
filter[Op.and].push({
671+
[Op.or]: [
672+
{ featured: true },
673+
{ showInHotList: true }
674+
]
675+
})
676+
}
669677
const jobs = await Job.findAll({
670678
where: filter,
671679
offset: ((page - 1) * perPage),

0 commit comments

Comments
 (0)