mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 20:40:55 +00:00
22 lines
612 B
TypeScript
22 lines
612 B
TypeScript
import { BaseRepository } from "@edr/api-common";
|
|
import { Injectable } from "@nestjs/common";
|
|
import { InjectRepository } from "@nestjs/typeorm";
|
|
import { Repository } from "typeorm";
|
|
|
|
import { Customer } from "./entities/customer.entity";
|
|
|
|
@Injectable()
|
|
export class CustomersRepository extends BaseRepository<Customer> {
|
|
constructor(
|
|
@InjectRepository(Customer)
|
|
repository: Repository<Customer>,
|
|
) {
|
|
super(repository);
|
|
}
|
|
|
|
/** Find a customer by their unique email. */
|
|
findByEmail(email: string): Promise<Customer | null> {
|
|
return this.repository.findOne({ where: { email } });
|
|
}
|
|
}
|