Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit a28ba76

Browse files
committed
For #127: Missing DLP status display on issue
1 parent ceb9480 commit a28ba76

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

DLPTrigger/lambda.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import handleGetRequest from './handlers/get'
21
import * as aws from 'aws-lambda'
2+
import handleGetRequest from './handlers/get'
33
import handlePostRequest from './handlers/post'
44
import handleOptionsRequest from './handlers/options'
55

@@ -57,6 +57,10 @@ export async function handle (event: aws.APIGatewayEvent, context: aws.Context)
5757
body = { message: 'Unsupported Method.' }
5858
break
5959
}
60+
body = {
61+
success: true,
62+
data: body
63+
}
6064
} catch (err) {
6165
if (err.isBoom) {
6266
statusCode = err.output.statusCode
@@ -69,9 +73,15 @@ export async function handle (event: aws.APIGatewayEvent, context: aws.Context)
6973
console.error(`Error occurred: ${err.message as string}`)
7074
console.error(err.stack)
7175
statusCode = 500
72-
body = { message: 'Internal Server Error' }
76+
body = {
77+
success: false,
78+
message: 'Internal Server Error'
79+
}
7380
}
7481
}
75-
76-
return { statusCode, headers, body: body ? JSON.stringify(body) : body }
82+
return {
83+
statusCode,
84+
headers,
85+
body: body ? JSON.stringify(body) : body
86+
}
7787
}

0 commit comments

Comments
 (0)