You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
457 B
12 lines
457 B
import { EntityRepository, Repository } from 'typeorm';
|
|
import { {{ properCase name }} } from './{{ kebabCase name }}.entity';
|
|
import Optional from 'typescript-optional';
|
|
|
|
@EntityRepository({{ properCase name }})
|
|
export class {{ properCase name }}Repository extends Repository<{{ properCase name }}> {
|
|
async findOneById(id: number): Promise<Optional<{{ properCase name }}>> {
|
|
return Optional.ofNullable(
|
|
await this.findOne(id, {}),
|
|
);
|
|
}
|
|
}
|