mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
refactor(core): fix for no-uncaught-json-parse warnings
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
INodeExecutionData,
|
||||
INodeType,
|
||||
INodeTypeDescription,
|
||||
jsonParse,
|
||||
NodeOperationError,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
@@ -206,7 +207,9 @@ export class RespondToWebhook implements INodeType {
|
||||
if (respondWith === 'json') {
|
||||
const responseBodyParameter = this.getNodeParameter('responseBody', 0) as string;
|
||||
if (responseBodyParameter) {
|
||||
responseBody = JSON.parse(responseBodyParameter);
|
||||
responseBody = jsonParse(responseBodyParameter, {
|
||||
errorMessage: "Invalid JSON in 'Response Body' field",
|
||||
});
|
||||
}
|
||||
} else if (respondWith === 'firstIncomingItem') {
|
||||
responseBody = items[0].json;
|
||||
|
||||
Reference in New Issue
Block a user