refactor(core): fix for no-uncaught-json-parse warnings

This commit is contained in:
Michael Kret
2022-10-21 21:52:43 +03:00
committed by GitHub
parent ca9eca9ae9
commit 1d57b10942
36 changed files with 150 additions and 93 deletions

View File

@@ -12,6 +12,7 @@ import {
INodeType,
INodeTypeBaseDescription,
INodeTypeDescription,
jsonParse,
NodeApiError,
} from 'n8n-workflow';
@@ -528,7 +529,7 @@ export class NotionV2 implements INodeType {
} else if (filterType === 'json') {
const filterJson = this.getNodeParameter('filterJson', i) as string;
if (validateJSON(filterJson) !== undefined) {
body.filter = JSON.parse(filterJson);
body.filter = jsonParse(filterJson);
} else {
throw new NodeApiError(this.getNode(), {
message: 'Filters (JSON) must be a valid json',