mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
refactor(core): fix for no-uncaught-json-parse warnings
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { IExecuteFunctions, IExecuteSingleFunctions, ILoadOptionsFunctions } from 'n8n-core';
|
||||
import { IDataObject } from 'n8n-workflow';
|
||||
import { IDataObject, jsonParse } from 'n8n-workflow';
|
||||
import { ICollection } from './CollectionInterface';
|
||||
import { cockpitApiRequest } from './GenericFunctions';
|
||||
|
||||
@@ -46,7 +46,9 @@ export async function getAllCollectionEntries(
|
||||
}
|
||||
|
||||
if (options.filter) {
|
||||
body.filter = JSON.parse(options.filter.toString());
|
||||
body.filter = jsonParse(options.filter.toString(), {
|
||||
errorMessage: "'Filter' option is not valid JSON",
|
||||
});
|
||||
}
|
||||
|
||||
if (options.limit) {
|
||||
@@ -58,7 +60,9 @@ export async function getAllCollectionEntries(
|
||||
}
|
||||
|
||||
if (options.sort) {
|
||||
body.sort = JSON.parse(options.sort.toString());
|
||||
body.sort = jsonParse(options.sort.toString(), {
|
||||
errorMessage: "'Sort' option is not valid JSON",
|
||||
});
|
||||
}
|
||||
|
||||
if (options.populate) {
|
||||
|
||||
Reference in New Issue
Block a user