Compare commits
No commits in common. "bcea5099bcc23d60e62b028ea93bce9b426d6fe2" and "a10798700074621f040979c5367296b81e70ed77" have entirely different histories.
bcea5099bc
...
a107987000
1 changed files with 17 additions and 21 deletions
|
@ -5,29 +5,25 @@ import { Cat } from "./cats.entity";
|
|||
|
||||
@Injectable()
|
||||
export class CatsService {
|
||||
constructor(
|
||||
@InjectRepository(Cat)
|
||||
private catsRepository: Repository<Cat>,
|
||||
) { }
|
||||
constructor(
|
||||
@InjectRepository(Cat)
|
||||
private catsRepository: Repository<Cat>,
|
||||
) {}
|
||||
|
||||
private readonly logger = new Logger(CatsService.name);
|
||||
private readonly logger = new Logger(CatsService.name);
|
||||
|
||||
findAll(): Promise<Cat[]> {
|
||||
this.logger.log("[findAll] Starting...");
|
||||
return this.catsRepository.find();
|
||||
}
|
||||
findAll(): Promise<Cat[]> {
|
||||
this.logger.log("[findAll] Starting...");
|
||||
return this.catsRepository.find();
|
||||
}
|
||||
|
||||
findOne(id: number): Promise<Cat | null> {
|
||||
this.logger.log("[findOne] Starting...");
|
||||
return this.catsRepository.findOneBy({ id });
|
||||
}
|
||||
findOne(id: number): Promise<Cat | null> {
|
||||
this.logger.log("[findOne] Starting...");
|
||||
return this.catsRepository.findOneBy({ id });
|
||||
}
|
||||
|
||||
async remove(id: number): Promise<void> {
|
||||
this.logger.log("[remove] Starting...");
|
||||
await this.catsRepository.delete(id)
|
||||
}
|
||||
|
||||
lazygitTest(): void {
|
||||
this.logger.log("[lazygitTest] test no. 1")
|
||||
}
|
||||
async remove(id: number): Promise<void> {
|
||||
this.logger.log("[remove] Starting...");
|
||||
await this.catsRepository.delete(id)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue