diff --git a/src/controllers/ControllerV1.ts b/src/controllers/ControllerV1.ts index e5a73db..84de8b5 100644 --- a/src/controllers/ControllerV1.ts +++ b/src/controllers/ControllerV1.ts @@ -4,7 +4,6 @@ import { Controller, Delete, Get, - HttpStatusCodeLiteral, Post, Put, Query, @@ -19,8 +18,6 @@ import { StateLockRequest } from '../models/interfaces/StateLockRequest'; import { GithubService } from '../services/GithubService'; import { StateService } from '../services/StateService'; -type HeaderType = { [key: string]: string | string[] }; - @Route('/v1') @Tags('v1') export class ControllerV1 extends Controller { @@ -38,7 +35,7 @@ export class ControllerV1 extends Controller { public async getState( @Request() request: HttpRequest, @Res() res: TsoaResponse<200 | 400 | 401 | 404, any>, - ): Promise> { + ): Promise { try { const identity = await this.githubService.getIdentity(request); const state = await this.stateService.getState(identity); @@ -59,7 +56,7 @@ export class ControllerV1 extends Controller { // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types @Body() state: any, @Res() res: TsoaResponse<200 | 400 | 401 | 404 | 409, void>, - ): Promise> { + ): Promise { try { const stateLockRequest = await this.stateService.getRequest(id); const identity = await this.githubService.getIdentity(request, stateLockRequest); @@ -79,7 +76,7 @@ export class ControllerV1 extends Controller { @Request() request: HttpRequest, @Body() lockRequest: StateLockRequest, @Res() res: TsoaResponse<200 | 400 | 401 | 404 | 409, boolean>, - ): Promise> { + ): Promise { try { const stateLockRequest = await this.stateService.saveRequest(lockRequest); const identity = await this.githubService.getIdentity(request, stateLockRequest); @@ -99,7 +96,7 @@ export class ControllerV1 extends Controller { @Request() request: HttpRequest, @Body() lockRequest: StateLockRequest, @Res() res: TsoaResponse<200 | 400 | 401 | 404 | 409, boolean>, - ): Promise> { + ): Promise { try { const stateLockRequest = await this.stateService.getRequest(lockRequest.ID); const identity = await this.githubService.getIdentity(request, stateLockRequest); diff --git a/src/interfaces/errors.ts b/src/interfaces/errors.ts index 26bfa98..d1d7fcb 100644 --- a/src/interfaces/errors.ts +++ b/src/interfaces/errors.ts @@ -6,7 +6,7 @@ export class TerraformError extends Error { super(); } - respond = (res: TsoaResponse): TsoaResponse => { + respond = (res: TsoaResponse): any => { if (!this.body) { return res(this.statusCode, {}); }