n8n-3867-progressively-apply-prettier-to-all (#3873)

* 🔨 formatting nodes with prettier
This commit is contained in:
Michael Kret
2022-08-17 18:50:24 +03:00
committed by GitHub
parent f2d326c7f0
commit 91d7e16c81
1072 changed files with 42357 additions and 59109 deletions

View File

@@ -1,22 +1,28 @@
import {
IExecuteFunctions,
} from 'n8n-core';
import { IExecuteFunctions } from 'n8n-core';
import {
IDataObject,
INodeExecutionData,
NodeApiError,
} from 'n8n-workflow';
import { IDataObject, INodeExecutionData, NodeApiError } from 'n8n-workflow';
import {
apiRequest,
} from '../../../transport';
import { apiRequest } from '../../../transport';
export async function updateCustomer(this: IExecuteFunctions, index: number): Promise<INodeExecutionData[]> {
export async function updateCustomer(
this: IExecuteFunctions,
index: number,
): Promise<INodeExecutionData[]> {
const id = this.getNodeParameter('customerId', index) as IDataObject;
const { address, businessName, email, firstName, getSms, invoiceCcEmails,
lastName, noEmail, notes, notificationEmail, phone, referredBy } = this.getNodeParameter('updateFields', index) as IDataObject;
const {
address,
businessName,
email,
firstName,
getSms,
invoiceCcEmails,
lastName,
noEmail,
notes,
notificationEmail,
phone,
referredBy,
} = this.getNodeParameter('updateFields', index) as IDataObject;
const qs = {} as IDataObject;
const requestMethod = 'PUT';
@@ -35,7 +41,7 @@ export async function updateCustomer(this: IExecuteFunctions, index: number): Pr
email,
firstname: firstName,
get_sms: getSms,
invoice_cc_emails: (invoiceCcEmails as string[] || []).join(','),
invoice_cc_emails: ((invoiceCcEmails as string[]) || []).join(','),
lastname: lastName,
no_email: noEmail,
notes,
@@ -47,7 +53,10 @@ export async function updateCustomer(this: IExecuteFunctions, index: number): Pr
let responseData;
responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs);
if (!responseData.customer) {
throw new NodeApiError(this.getNode(), responseData, { httpCode: '404', message: 'Customer ID not found' });
throw new NodeApiError(this.getNode(), responseData, {
httpCode: '404',
message: 'Customer ID not found',
});
}
return this.helpers.returnJsonArray(responseData.customer);
}