Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed misspelt Class and removed unused code #31

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/api/api-information.dto.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Exclude, Expose, Type } from "class-transformer"
import { Exclude, Expose } from "class-transformer"
import { ApiProperty } from "@nestjs/swagger"

@Exclude()
Expand Down
6 changes: 3 additions & 3 deletions src/api/game/game.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Tournament } from "../tournament/tournament.entity"
import { Game } from "./game.entity"
import { UpdateGameDto } from "./dto/update-game.dto"
import { TournamentState } from "../tournament/tournament-state"
import { IlegalTournamentStateException } from "../shared/error/ilegal-tournament-state.exception"
import { IllegalTournamentStateException } from "../shared/error/illegal-tournament-state.exception"
import { CreateGameDto } from "./dto/create-game.dto"
import { Connection } from "typeorm"
import { plainToClass } from "class-transformer"
Expand Down Expand Up @@ -33,7 +33,7 @@ export class GameService {
tournament: Tournament,
createGameDtos: CreateGameDto[],
): Promise<Game[]> {
const games = createGameDtos.map(g => {
const games = createGameDtos.map((g) => {
const game = new Game()
game.tournament = tournament
game.round = g.round
Expand Down Expand Up @@ -81,7 +81,7 @@ export class GameService {

private verifyChange(tournament: Tournament) {
if (tournament.state !== TournamentState.Playable) {
throw new IlegalTournamentStateException(
throw new IllegalTournamentStateException(
"Games can only be update during the Playable state",
)
}
Expand Down
4 changes: 2 additions & 2 deletions src/api/generator/generator.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { PairingTableService } from "./paring-table.service"
import { Tournament } from "../tournament/tournament.entity"
import { Game } from "../game/game.entity"
import { TournamentState } from "../tournament/tournament-state"
import { IlegalTournamentStateException } from "../shared/error/ilegal-tournament-state.exception"
import { IllegalTournamentStateException } from "../shared/error/illegal-tournament-state.exception"
import { Team } from "../team/team.entity"
import { TeamService } from "../team/team.service"

Expand All @@ -23,7 +23,7 @@ export class GeneratorService {
tournament.state !== TournamentState.Open &&
tournament.state !== TournamentState.Playable
) {
throw new IlegalTournamentStateException(
throw new IllegalTournamentStateException(
"A schedule can only be generaten during the open or playable state of the Tournament",
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HttpException, HttpStatus } from "@nestjs/common"

export class IlegalTournamentStateException extends HttpException {
export class IllegalTournamentStateException extends HttpException {
constructor(message: string) {
super(message, HttpStatus.BAD_REQUEST)
}
Expand Down
4 changes: 2 additions & 2 deletions src/api/team/team.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { CreateTeamDto } from "./dto/create-team.dto"
import { UpdateTeamDto } from "./dto/update-team.dto"
import { TeamNameUniqueException } from "../shared/error/team-name-unique.exception"
import { TournamentState } from "../tournament/tournament-state"
import { IlegalTournamentStateException } from "../shared/error/ilegal-tournament-state.exception"
import { IllegalTournamentStateException } from "../shared/error/illegal-tournament-state.exception"

@Injectable()
export class TeamService {
Expand Down Expand Up @@ -77,7 +77,7 @@ export class TeamService {

private verifyTeamChange(tournament: Tournament) {
if (tournament.state !== TournamentState.Open) {
throw new IlegalTournamentStateException(
throw new IllegalTournamentStateException(
"Teams can only be changed during the Open state",
)
}
Expand Down
8 changes: 4 additions & 4 deletions src/api/tournament/tournament.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { CreateTournamentDto } from "./dto/create-tournament.dto"
import { TournamentState } from "./tournament-state"
import { TournamentCreatedMail } from "./tournament-created.mail"
import { UpdateTournamentDto } from "./dto/update-tournament.dto"
import { IlegalTournamentStateException } from "../shared/error/ilegal-tournament-state.exception"
import { IllegalTournamentStateException } from "../shared/error/illegal-tournament-state.exception"

@Injectable()
export class TournamentService {
Expand Down Expand Up @@ -71,16 +71,16 @@ export class TournamentService {
tournament.state === TournamentState.Open &&
updateTournamentDto.state !== TournamentState.Playable
) {
throw new IlegalTournamentStateException("Illegal state change")
throw new IllegalTournamentStateException("Illegal state change")
}
if (
tournament.state === TournamentState.Playable &&
updateTournamentDto.state !== TournamentState.Closed
) {
throw new IlegalTournamentStateException("Illegal state change")
throw new IllegalTournamentStateException("Illegal state change")
}
if (tournament.state === TournamentState.Closed) {
throw new IlegalTournamentStateException("Illegal state change")
throw new IllegalTournamentStateException("Illegal state change")
}
}
tournament.name = updateTournamentDto.name || tournament.name
Expand Down