@@ -34,7 +34,7 @@ export class ControllerV1 extends Controller {
3434 @Get ( )
3535 public async getState (
3636 @Request ( ) request : HttpRequest ,
37- @Res ( ) res : TsoaResponse < 200 | 400 | 401 | 404 , any > ,
37+ @Res ( ) res : TsoaResponse < 200 | 401 | 403 | 404 , any > ,
3838 ) : Promise < any > {
3939 try {
4040 const identity = await this . githubService . getIdentity ( request ) ;
@@ -55,7 +55,7 @@ export class ControllerV1 extends Controller {
5555 @Query ( 'ID' ) id : string ,
5656 // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
5757 @Body ( ) state : any ,
58- @Res ( ) res : TsoaResponse < 200 | 400 | 401 | 404 | 409 , void > ,
58+ @Res ( ) res : TsoaResponse < 200 | 400 | 401 | 403 | 404 | 409 , void > ,
5959 ) : Promise < void > {
6060 try {
6161 const stateLockRequest = await this . stateService . getRequest ( id ) ;
@@ -75,7 +75,7 @@ export class ControllerV1 extends Controller {
7575 public async lockState (
7676 @Request ( ) request : HttpRequest ,
7777 @Body ( ) lockRequest : StateLockRequest ,
78- @Res ( ) res : TsoaResponse < 200 | 400 | 401 | 404 | 409 , boolean > ,
78+ @Res ( ) res : TsoaResponse < 200 | 401 | 403 | 404 | 409 , boolean > ,
7979 ) : Promise < boolean > {
8080 try {
8181 const stateLockRequest = await this . stateService . saveRequest ( lockRequest ) ;
@@ -95,12 +95,13 @@ export class ControllerV1 extends Controller {
9595 public async unlockState (
9696 @Request ( ) request : HttpRequest ,
9797 @Body ( ) lockRequest : StateLockRequest ,
98- @Res ( ) res : TsoaResponse < 200 | 400 | 401 | 404 | 409 , boolean > ,
98+ @Res ( ) res : TsoaResponse < 200 | 401 | 403 | 404 | 409 , boolean > ,
99+ @Query ( 'force' ) force = false ,
99100 ) : Promise < boolean > {
100101 try {
101102 const stateLockRequest = await this . stateService . getRequest ( lockRequest . ID ) ;
102103 const identity = await this . githubService . getIdentity ( request , stateLockRequest ) ;
103- await this . stateService . unlockState ( identity , stateLockRequest ) ;
104+ await this . stateService . unlockState ( identity , stateLockRequest , force ) ;
104105 const response = res ( 200 , true ) ;
105106 return response ;
106107 } catch ( e ) {
0 commit comments