refactor(api): simplify services logic

This commit is contained in:
yassinedorbozgithub
2024-10-12 12:44:32 +01:00
parent a9070580bd
commit f53589b06d
5 changed files with 2 additions and 115 deletions

View File

@@ -33,8 +33,8 @@ export abstract class BaseService<
return await this.repository.findOne(criteria, options);
}
async findOneAndPopulate(id: string) {
return await this.repository.findOneAndPopulate(id);
async findOneAndPopulate(criteria: string | TFilterQuery<T>) {
return await this.repository.findOneAndPopulate(criteria);
}
async find(filter: TFilterQuery<T>, sort?: QuerySortDto<T>): Promise<T[]> {