Initial commit

This commit is contained in:
2024-12-27 22:54:31 +01:00
parent 024834d309
commit a3dc01171a
19 changed files with 272 additions and 2325 deletions
+8 -4
View File
@@ -11,10 +11,12 @@ import { Repository } from 'typeorm';
@Injectable()
export class GamePipe implements PipeTransform {
constructor(@InjectRepository(Game) private gameRepository: Repository<Game>) {}
constructor(
@InjectRepository(Game) private gameRepository: Repository<Game>,
) {}
async transform(value: any) {
const game = await this.gameRepository.findBy({id: value});
const game = await this.gameRepository.findBy({ id: value });
if (!game) {
throw new HttpException('Game not found', HttpStatus.NOT_FOUND);
}
@@ -24,10 +26,12 @@ export class GamePipe implements PipeTransform {
@Injectable()
export class GameStartedPipe implements PipeTransform {
constructor(@InjectRepository(Game) private gameRepository: Repository<Game>) {}
constructor(
@InjectRepository(Game) private gameRepository: Repository<Game>,
) {}
async transform(value: any) {
const game = await this.gameRepository.findBy({id: value});
const game = await this.gameRepository.findOne(value);
if (!game) {
throw new HttpException('Game not found', HttpStatus.NOT_FOUND);
}