This commit is contained in:
magdo
2025-10-27 20:22:39 +01:00
parent 825d7a91e2
commit 04954cec4a
12 changed files with 24 additions and 59 deletions
@@ -39,7 +39,7 @@ export class GameRepository implements IGameRepository {
// Get paginated results
const games = await this.repo.find({
where: { state: Not(GameState.CANCELLED) },
order: { updatedate: 'DESC' },
order: { updateDate: 'DESC' },
take: limit,
skip: offset
});
@@ -67,7 +67,7 @@ export class GameRepository implements IGameRepository {
// Get paginated results (including deleted)
const games = await this.repo.find({
order: { updatedate: 'DESC' },
order: { updateDate: 'DESC' },
take: limit,
skip: offset
});
@@ -153,7 +153,7 @@ export class GameRepository implements IGameRepository {
queryBuilder.skip(offset);
}
const games = await queryBuilder.orderBy('game.updatedate', 'DESC').getMany();
const games = await queryBuilder.orderBy('game.updateDate', 'DESC').getMany();
const endTime = performance.now();
logDatabase('Game search completed', `executionTime: ${Math.round(endTime - startTime)}ms, query: ${query}, found: ${games.length}, total: ${totalCount}`);
@@ -184,7 +184,7 @@ export class GameRepository implements IGameRepository {
queryBuilder.skip(offset);
}
const games = await queryBuilder.orderBy('game.updatedate', 'DESC').getMany();
const games = await queryBuilder.orderBy('game.updateDate', 'DESC').getMany();
const endTime = performance.now();
logDatabase('Game search (including deleted) completed', `executionTime: ${Math.round(endTime - startTime)}ms, query: ${query}, found: ${games.length}, total: ${totalCount}`);
@@ -251,7 +251,7 @@ export class GameRepository implements IGameRepository {
try {
const games = await this.repo.find({
where: { state: GameState.ACTIVE },
order: { updatedate: 'DESC' }
order: { updateDate: 'DESC' }
});
const endTime = performance.now();
logDatabase('Active games query completed', `executionTime: ${Math.round(endTime - startTime)}ms, found: ${games.length}`);
@@ -270,7 +270,7 @@ export class GameRepository implements IGameRepository {
const queryBuilder = this.repo.createQueryBuilder('game')
.where('game.state != :cancelledState', { cancelledState: GameState.CANCELLED })
.andWhere('JSON_CONTAINS(game.players, :playerId)', { playerId: `"${playerId}"` })
.orderBy('game.updatedate', 'DESC');
.orderBy('game.updateDate', 'DESC');
const games = await queryBuilder.getMany();
const endTime = performance.now();