Skip to content

Commit

Permalink
fix(lambda): ✨ update lambdaGetParameters (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
Viserion77 authored Apr 8, 2024
1 parent b475b64 commit 9cb5935
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"cSpell.words": [
"Adapcon",
"cnpj",
"Docfy",
"hotmail",
"portaldocliente",
"simplificamais"
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "adapcon-utils-js",
"version": "1.3.1",
"version": "1.3.2",
"description": "Utils library for Javascript",
"keywords": [],
"author": {
Expand Down
6 changes: 4 additions & 2 deletions src/lambda/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ export type DocfySettings = {
}

export type Docfy = {
type: 'screen' | 'integration' | 'public' | 'session'
type: 'screen' | 'integration' | 'public' | 'session' | 'hybrid'
description: string
pathParameters?: { [key: string]: DocfySettings }
body?: { [key: string]: DocfySettings }
queryStringParameters: { [key: string]: DocfySettings }
headers?: { [key: string]: DocfySettings }
body?: { [key: string]: DocfySettings }
requestContext?: { [key: string]: DocfySettings }
}
4 changes: 2 additions & 2 deletions src/lambda/lambdaGetParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ export const lambdaSettingsGetParameters = <T>(docfy: Docfy, evt: APIGatewayEven

if (docfy.body) {
try {
const evtobj = {
const evtObj = {
body: JSON.parse(get(evt, 'body'))
}
const requestBody: { params: Params, errs: Errs } = extractParams(docfy, 'body', evtobj as APIGatewayEvent)
const requestBody: { params: Params, errs: Errs } = extractParams(docfy, 'body', evtObj as APIGatewayEvent)
Object.assign(parameters, requestBody.params)
Object.assign(errs, requestBody.errs)
} catch (err) {
Expand Down

0 comments on commit 9cb5935

Please sign in to comment.