Skip to content

Commit 562f1ed

Browse files
committed
fix tsoa
1 parent 2fa47fb commit 562f1ed

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/controllers/ControllerV1.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
Controller,
55
Delete,
66
Get,
7-
HttpStatusCodeLiteral,
87
Post,
98
Put,
109
Query,
@@ -19,8 +18,6 @@ import { StateLockRequest } from '../models/interfaces/StateLockRequest';
1918
import { GithubService } from '../services/GithubService';
2019
import { StateService } from '../services/StateService';
2120

22-
type HeaderType = { [key: string]: string | string[] };
23-
2421
@Route('/v1')
2522
@Tags('v1')
2623
export class ControllerV1 extends Controller {
@@ -38,7 +35,7 @@ export class ControllerV1 extends Controller {
3835
public async getState(
3936
@Request() request: HttpRequest,
4037
@Res() res: TsoaResponse<200 | 400 | 401 | 404, any>,
41-
): Promise<TsoaResponse<HttpStatusCodeLiteral, any, HeaderType>> {
38+
): Promise<any> {
4239
try {
4340
const identity = await this.githubService.getIdentity(request);
4441
const state = await this.stateService.getState(identity);
@@ -59,7 +56,7 @@ export class ControllerV1 extends Controller {
5956
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
6057
@Body() state: any,
6158
@Res() res: TsoaResponse<200 | 400 | 401 | 404 | 409, void>,
62-
): Promise<TsoaResponse<HttpStatusCodeLiteral, void, HeaderType>> {
59+
): Promise<void> {
6360
try {
6461
const stateLockRequest = await this.stateService.getRequest(id);
6562
const identity = await this.githubService.getIdentity(request, stateLockRequest);
@@ -79,7 +76,7 @@ export class ControllerV1 extends Controller {
7976
@Request() request: HttpRequest,
8077
@Body() lockRequest: StateLockRequest,
8178
@Res() res: TsoaResponse<200 | 400 | 401 | 404 | 409, boolean>,
82-
): Promise<TsoaResponse<HttpStatusCodeLiteral, boolean, HeaderType>> {
79+
): Promise<boolean> {
8380
try {
8481
const stateLockRequest = await this.stateService.saveRequest(lockRequest);
8582
const identity = await this.githubService.getIdentity(request, stateLockRequest);
@@ -99,7 +96,7 @@ export class ControllerV1 extends Controller {
9996
@Request() request: HttpRequest,
10097
@Body() lockRequest: StateLockRequest,
10198
@Res() res: TsoaResponse<200 | 400 | 401 | 404 | 409, boolean>,
102-
): Promise<TsoaResponse<HttpStatusCodeLiteral, boolean, HeaderType>> {
99+
): Promise<boolean> {
103100
try {
104101
const stateLockRequest = await this.stateService.getRequest(lockRequest.ID);
105102
const identity = await this.githubService.getIdentity(request, stateLockRequest);

src/interfaces/errors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export class TerraformError extends Error {
66
super();
77
}
88

9-
respond = (res: TsoaResponse<any, any>): TsoaResponse<any, any> => {
9+
respond = (res: TsoaResponse<any, any>): any => {
1010
if (!this.body) {
1111
return res(this.statusCode, {});
1212
}

0 commit comments

Comments
 (0)