mirror of
https://github.com/hexastack/hexabot
synced 2025-02-24 05:14:47 +00:00
fix: findOne implementation
This commit is contained in:
parent
52ecbe60d3
commit
de459fcbac
@ -234,10 +234,8 @@ export abstract class BaseRepository<
|
|||||||
// @TODO : Issue a warning ?
|
// @TODO : Issue a warning ?
|
||||||
return Promise.resolve(undefined);
|
return Promise.resolve(undefined);
|
||||||
}
|
}
|
||||||
const query =
|
|
||||||
typeof criteria === 'string'
|
const query = this.findOneQuery(criteria);
|
||||||
? this.model.findById<T>(criteria)
|
|
||||||
: this.model.findOne<T>(criteria);
|
|
||||||
return await this.executeOne(query, this.cls, options);
|
return await this.executeOne(query, this.cls, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user