Skip to content
Snippets Groups Projects
Commit 2d98fc66 authored by Hugo SUBTIL's avatar Hugo SUBTIL
Browse files

feat(jobs): add filtering of unvalidated jobs

parent d264a4ee
No related branches found
No related tags found
3 merge requests!247V2.1.0,!242V2.0,!127V2.0
......@@ -10,9 +10,13 @@ export class JobsService {
constructor(@InjectModel(Job.name) private jobModel: Model<JobDocument>) {}
public async findAll(): Promise<Job[]> {
this.logger.debug('findAll');
return this.jobModel.find();
public async findAll(filterValidetedJobs = true): Promise<Job[]> {
this.logger.debug(`findAll with filterValidetedJobs: ${filterValidetedJobs}`);
if (!filterValidetedJobs) {
return this.jobModel.find();
} else {
return this.jobModel.find({ validated: true });
}
}
public async findByName(name: string): Promise<JobDocument> {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment