mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -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 item: INodeExecutionData;
|
||||||
let keepOnlySet: boolean;
|
let keepOnlySet: boolean;
|
||||||
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
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];
|
item = items[itemIndex];
|
||||||
const options = this.getNodeParameter('options', itemIndex, {}) as IDataObject;
|
const options = this.getNodeParameter('options', itemIndex, {}) as IDataObject;
|
||||||
|
|
||||||
|
|
|
@ -580,8 +580,8 @@ export class Chargebee implements INodeType {
|
||||||
|
|
||||||
requestMethod = 'POST';
|
requestMethod = 'POST';
|
||||||
|
|
||||||
const subscriptionId = this.getNodeParameter('subscriptionId', i, {}) as string;
|
const subscriptionId = this.getNodeParameter('subscriptionId', i, '') as string;
|
||||||
body.end_of_term = this.getNodeParameter('endOfTerm', i, {}) as boolean;
|
body.end_of_term = this.getNodeParameter('endOfTerm', i, false) as boolean;
|
||||||
|
|
||||||
endpoint = `subscriptions/${subscriptionId.trim()}/cancel`;
|
endpoint = `subscriptions/${subscriptionId.trim()}/cancel`;
|
||||||
} else if (operation === 'delete') {
|
} else if (operation === 'delete') {
|
||||||
|
@ -591,7 +591,7 @@ export class Chargebee implements INodeType {
|
||||||
|
|
||||||
requestMethod = 'POST';
|
requestMethod = 'POST';
|
||||||
|
|
||||||
const subscriptionId = this.getNodeParameter('subscriptionId', i, {}) as string;
|
const subscriptionId = this.getNodeParameter('subscriptionId', i, '') as string;
|
||||||
|
|
||||||
endpoint = `subscriptions/${subscriptionId.trim()}/delete`;
|
endpoint = `subscriptions/${subscriptionId.trim()}/delete`;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -50,7 +50,7 @@ export function createDataFromParameters(this: IExecuteFunctions | IExecuteSingl
|
||||||
|
|
||||||
if (dataFieldsAreJson) {
|
if (dataFieldsAreJson) {
|
||||||
// Parameters are defined as JSON
|
// 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
|
// Parameters are defined in UI
|
||||||
|
|
|
@ -236,7 +236,7 @@ export class GraphQL implements INodeType {
|
||||||
requestOptions.body = {
|
requestOptions.body = {
|
||||||
query: gqlQuery,
|
query: gqlQuery,
|
||||||
variables: this.getNodeParameter('variables', itemIndex, {}) as object,
|
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') {
|
if (typeof requestOptions.body.variables === 'string') {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -142,7 +142,7 @@ export class Set implements INodeType {
|
||||||
let item: INodeExecutionData;
|
let item: INodeExecutionData;
|
||||||
let keepOnlySet: boolean;
|
let keepOnlySet: boolean;
|
||||||
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
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];
|
item = items[itemIndex];
|
||||||
const options = this.getNodeParameter('options', itemIndex, {}) as IDataObject;
|
const options = this.getNodeParameter('options', itemIndex, {}) as IDataObject;
|
||||||
|
|
||||||
|
|
|
@ -741,7 +741,7 @@ export class Slack implements INodeType {
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} 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;
|
const blocksJson = this.getNodeParameter('blocksJson', i, []) as string;
|
||||||
if (attachmentsJson !== '' && validateJSON(attachmentsJson) === undefined) {
|
if (attachmentsJson !== '' && validateJSON(attachmentsJson) === undefined) {
|
||||||
throw new Error('Attachments it is not a valid json');
|
throw new Error('Attachments it is not a valid json');
|
||||||
|
|
Loading…
Reference in a new issue