diff --git a/api/src/utils/generics/base-repository.ts b/api/src/utils/generics/base-repository.ts index 76846bb2..00203f99 100644 --- a/api/src/utils/generics/base-repository.ts +++ b/api/src/utils/generics/base-repository.ts @@ -234,10 +234,8 @@ export abstract class BaseRepository< // @TODO : Issue a warning ? return Promise.resolve(undefined); } - const query = - typeof criteria === 'string' - ? this.model.findById(criteria) - : this.model.findOne(criteria); + + const query = this.findOneQuery(criteria); return await this.executeOne(query, this.cls, options); }