mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 00:05:02 +00:00
chore: fmt
This commit is contained in:
@@ -5,13 +5,16 @@ import {
|
||||
FindOptionsWhere,
|
||||
ObjectLiteral,
|
||||
Repository,
|
||||
} from 'typeorm';
|
||||
} from "typeorm";
|
||||
|
||||
export abstract class BaseRepository<T extends ObjectLiteral> {
|
||||
protected constructor(protected readonly repository: Repository<T>) {}
|
||||
|
||||
/** Find a single entity by its primary key. */
|
||||
async findById(id: string, options?: Omit<FindOneOptions<T>, 'where'>): Promise<T | null> {
|
||||
async findById(
|
||||
id: string,
|
||||
options?: Omit<FindOneOptions<T>, "where">,
|
||||
): Promise<T | null> {
|
||||
return this.repository.findOne({
|
||||
...options,
|
||||
where: { id } as unknown as FindOptionsWhere<T>,
|
||||
|
||||
Reference in New Issue
Block a user