mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 04:47:29 -08:00
⚡ Replace some fallback values to match the value type (#1421)
This commit is contained in:
parent
5a214fb4aa
commit
5da61ef252
|
@ -596,7 +596,7 @@ class NodeTypesClass implements INodeTypes {
|
|||
let item: INodeExecutionData;
|
||||
let keepOnlySet: boolean;
|
||||
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
||||
keepOnlySet = this.getNodeParameter('keepOnlySet', itemIndex, []) as boolean;
|
||||
keepOnlySet = this.getNodeParameter('keepOnlySet', itemIndex, false) as boolean;
|
||||
item = items[itemIndex];
|
||||
const options = this.getNodeParameter('options', itemIndex, {}) as IDataObject;
|
||||
|
||||
|
|
|
@ -580,8 +580,8 @@ export class Chargebee implements INodeType {
|
|||
|
||||
requestMethod = 'POST';
|
||||
|
||||
const subscriptionId = this.getNodeParameter('subscriptionId', i, {}) as string;
|
||||
body.end_of_term = this.getNodeParameter('endOfTerm', i, {}) as boolean;
|
||||
const subscriptionId = this.getNodeParameter('subscriptionId', i, '') as string;
|
||||
body.end_of_term = this.getNodeParameter('endOfTerm', i, false) as boolean;
|
||||
|
||||
endpoint = `subscriptions/${subscriptionId.trim()}/cancel`;
|
||||
} else if (operation === 'delete') {
|
||||
|
@ -591,7 +591,7 @@ export class Chargebee implements INodeType {
|
|||
|
||||
requestMethod = 'POST';
|
||||
|
||||
const subscriptionId = this.getNodeParameter('subscriptionId', i, {}) as string;
|
||||
const subscriptionId = this.getNodeParameter('subscriptionId', i, '') as string;
|
||||
|
||||
endpoint = `subscriptions/${subscriptionId.trim()}/delete`;
|
||||
} else {
|
||||
|
|
|
@ -50,7 +50,7 @@ export function createDataFromParameters(this: IExecuteFunctions | IExecuteSingl
|
|||
|
||||
if (dataFieldsAreJson) {
|
||||
// Parameters are defined as JSON
|
||||
return JSON.parse(this.getNodeParameter('dataFieldsJson', itemIndex, {}) as string);
|
||||
return JSON.parse(this.getNodeParameter('dataFieldsJson', itemIndex, '') as string);
|
||||
}
|
||||
|
||||
// Parameters are defined in UI
|
||||
|
|
|
@ -236,7 +236,7 @@ export class GraphQL implements INodeType {
|
|||
requestOptions.body = {
|
||||
query: gqlQuery,
|
||||
variables: this.getNodeParameter('variables', itemIndex, {}) as object,
|
||||
operationName: this.getNodeParameter('operationName', itemIndex, null) as string,
|
||||
operationName: this.getNodeParameter('operationName', itemIndex) as string,
|
||||
};
|
||||
if (typeof requestOptions.body.variables === 'string') {
|
||||
try {
|
||||
|
|
|
@ -142,7 +142,7 @@ export class Set implements INodeType {
|
|||
let item: INodeExecutionData;
|
||||
let keepOnlySet: boolean;
|
||||
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
||||
keepOnlySet = this.getNodeParameter('keepOnlySet', itemIndex, []) as boolean;
|
||||
keepOnlySet = this.getNodeParameter('keepOnlySet', itemIndex, false) as boolean;
|
||||
item = items[itemIndex];
|
||||
const options = this.getNodeParameter('options', itemIndex, {}) as IDataObject;
|
||||
|
||||
|
|
|
@ -741,7 +741,7 @@ export class Slack implements INodeType {
|
|||
}
|
||||
|
||||
} else {
|
||||
const attachmentsJson = this.getNodeParameter('attachmentsJson', i, []) as string;
|
||||
const attachmentsJson = this.getNodeParameter('attachmentsJson', i, '') as string;
|
||||
const blocksJson = this.getNodeParameter('blocksJson', i, []) as string;
|
||||
if (attachmentsJson !== '' && validateJSON(attachmentsJson) === undefined) {
|
||||
throw new Error('Attachments it is not a valid json');
|
||||
|
|
Loading…
Reference in a new issue