Skip to content

Commit 2819883

Browse files
authored
Merge branch 'master' into all-contributors/add-evalphobia
2 parents 089052e + fcb3053 commit 2819883

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/modals/lambdaInvokeModal.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { invokeLambda } from "../services/invoke";
66

77
const blessed = require("blessed");
88

9+
const wrapPayload = (payload) => JSON.stringify({ body: payload });
10+
911
const lambdaInvokeModal = (
1012
screen,
1113
application,
@@ -73,8 +75,9 @@ const lambdaInvokeModal = (
7375
new Box(
7476
lambdaInvokeLayout,
7577
110,
76-
4,
77-
"Arrow keys to select field | ENTER to toggle edit mode \nENTER on Submit to inject event | ESC to close"
78+
6,
79+
// eslint-disable-next-line quotes
80+
'Arrow keys to select field | ENTER to toggle edit mode \n Note: payload wrapped {"body": {...}} \nENTER on Submit to inject event | ESC to close'
7881
);
7982

8083
lambdaInvokeLayout.focus();
@@ -84,7 +87,11 @@ const lambdaInvokeModal = (
8487
lambdaInvokeLayout.key(["enter"], () => {
8588
// Inject event or select field for entry
8689
if (currentTextbox === 2) {
87-
invokeLambda(awsLambdaApi, functionName, textboxes[1].getValue());
90+
invokeLambda(
91+
awsLambdaApi,
92+
functionName,
93+
wrapPayload(textboxes[1].getValue())
94+
);
8895
closeModal();
8996
} else {
9097
textboxes[currentTextbox].focus();

0 commit comments

Comments
 (0)