JobMethods
} from './job-interface'
-import { JobState } from '../../../shared/models/job.model'
+import { JobCategory, JobState } from '../../../shared/models/job.model'
let Job: Sequelize.Model<JobInstance, JobAttributes>
let listWithLimitByCategory: JobMethods.ListWithLimitByCategory
{
indexes: [
{
- fields: [ 'state' ]
+ fields: [ 'state', 'category' ]
}
]
}
// ---------------------------------------------------------------------------
-listWithLimitByCategory = function (limit: number, state: JobState) {
+listWithLimitByCategory = function (limit: number, state: JobState, jobCategory: JobCategory) {
const query = {
order: [
[ 'id', 'ASC' ]
],
limit: limit,
where: {
- state
+ state,
+ category: jobCategory
}
}