mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
refactor(core): fix for no-uncaught-json-parse warnings
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
INodeType,
|
||||
INodeTypeDescription,
|
||||
IWebhookResponseData,
|
||||
jsonParse,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { wufooApiRequest } from './GenericFunctions';
|
||||
@@ -153,7 +154,10 @@ export class WufooTrigger implements INodeType {
|
||||
return {};
|
||||
}
|
||||
|
||||
const fieldsObject = JSON.parse(req.body.FieldStructure);
|
||||
// tslint:disable-next-line:no-any
|
||||
const fieldsObject = jsonParse<any>(req.body.FieldStructure, {
|
||||
errorMessage: "Invalid JSON in request body field 'FieldStructure'",
|
||||
});
|
||||
|
||||
fieldsObject.Fields.map((field: IField) => {
|
||||
// TODO
|
||||
@@ -206,8 +210,12 @@ export class WufooTrigger implements INodeType {
|
||||
entryId: req.body.EntryId as number,
|
||||
dateCreated: req.body.DateCreated as Date,
|
||||
formId: req.body.FormId as string,
|
||||
formStructure: JSON.parse(req.body.FormStructure),
|
||||
fieldStructure: JSON.parse(req.body.FieldStructure),
|
||||
formStructure: jsonParse(req.body.FormStructure, {
|
||||
errorMessage: "Invalid JSON in request body field 'FormStructure'",
|
||||
}),
|
||||
fieldStructure: jsonParse(req.body.FieldStructure, {
|
||||
errorMessage: "Invalid JSON in request body field 'FieldStructure'",
|
||||
}),
|
||||
entries,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user