From bc80be947d073296010d13c9ec1b225e45f8869b Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 10 Dec 2020 17:42:49 +0100 Subject: [PATCH 1/2] Fixed optional property ref #13 #17 --- src/models/actions/CreateParticipant.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/actions/CreateParticipant.ts b/src/models/actions/CreateParticipant.ts index 9cd51ce..1bc45ac 100644 --- a/src/models/actions/CreateParticipant.ts +++ b/src/models/actions/CreateParticipant.ts @@ -17,7 +17,7 @@ export abstract class CreateParticipant { * Optional. */ @IsString() - @IsNotEmpty() + @IsOptional() middlename?: string; /** From 7fe9480c9408d1f3b51fe22c4fbf530e9cde0bf2 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 10 Dec 2020 17:43:00 +0100 Subject: [PATCH 2/2] Removed console logs --- src/authchecker.ts | 1 - src/controllers/RunnerController.ts | 1 - src/controllers/RunnerOrganisationController.ts | 1 - src/controllers/RunnerTeamController.ts | 1 - 4 files changed, 4 deletions(-) diff --git a/src/authchecker.ts b/src/authchecker.ts index 869e0da..00c84c1 100644 --- a/src/authchecker.ts +++ b/src/authchecker.ts @@ -18,7 +18,6 @@ const authchecker = async (action: Action, permissions: string | string[]) => { try { jwtPayload = jwt.verify(provided_token, config.jwt_secret); } catch (error) { - console.log(error); throw new IllegalJWTError() } const count = await getConnectionManager().get().getRepository(User).count({ id: jwtPayload["userdetails"]["id"], refreshTokenCount: jwtPayload["userdetails"]["refreshTokenCount"] }) diff --git a/src/controllers/RunnerController.ts b/src/controllers/RunnerController.ts index 53b869d..fe522ab 100644 --- a/src/controllers/RunnerController.ts +++ b/src/controllers/RunnerController.ts @@ -27,7 +27,6 @@ export class RunnerController { async getAll() { let responseRunners: ResponseRunner[] = new Array(); const runners = await this.runnerRepository.find({ relations: ['scans', 'group'] }); - console.log(runners); runners.forEach(runner => { responseRunners.push(new ResponseRunner(runner)); }); diff --git a/src/controllers/RunnerOrganisationController.ts b/src/controllers/RunnerOrganisationController.ts index 8471e90..d72eaea 100644 --- a/src/controllers/RunnerOrganisationController.ts +++ b/src/controllers/RunnerOrganisationController.ts @@ -29,7 +29,6 @@ export class RunnerOrganisationController { async getAll() { let responseTeams: ResponseRunnerOrganisation[] = new Array(); const runners = await this.runnerOrganisationRepository.find({ relations: ['address', 'contact', 'teams'] }); - console.log(runners); runners.forEach(runner => { responseTeams.push(new ResponseRunnerOrganisation(runner)); }); diff --git a/src/controllers/RunnerTeamController.ts b/src/controllers/RunnerTeamController.ts index 2eeae3e..64d9921 100644 --- a/src/controllers/RunnerTeamController.ts +++ b/src/controllers/RunnerTeamController.ts @@ -28,7 +28,6 @@ export class RunnerTeamController { async getAll() { let responseTeams: ResponseRunnerTeam[] = new Array(); const runners = await this.runnerTeamRepository.find({ relations: ['parentGroup', 'contact'] }); - console.log(runners); runners.forEach(runner => { responseTeams.push(new ResponseRunnerTeam(runner)); });