File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -47,15 +47,18 @@ export type TShallotSocketEvent<
4747
4848const ShallotSocketWrapper = < TEvent extends TShallotSocketEvent = TShallotSocketEvent > (
4949 handler : ShallotRawHandler < TEvent > ,
50- // eslint-disable-next-line @typescript-eslint/no-unused-vars
51- _successStatusCode = 200 ,
50+ successStatusCode = 200 ,
5251 middlewareOpts : {
5352 HttpErrorHandlerOpts ?: TShallotErrorHandlerOptions ;
5453 HttpJsonBodyParserOpts ?: TShallotJSONBodyParserOptions ;
5554 } = { }
5655) : ShallotAWSHandler < TEvent , APIGatewayProxyResult > => {
5756 const wrappedResponseHandler : Handler = async ( ...args ) => {
58- await handler ( ...args ) ;
57+ const res = await handler ( ...args ) ;
58+ return {
59+ statusCode : successStatusCode ,
60+ body : res == null ? undefined : JSON . stringify ( res ) ,
61+ } ;
5962 } ;
6063
6164 const wrapper = ShallotAWS ( wrappedResponseHandler )
You can’t perform that action at this time.
0 commit comments