mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
refactor(core): Allow custom types on getCredentials (no-changelog) (#10567)
This commit is contained in:
committed by
GitHub
parent
52c574d83f
commit
be52176585
@@ -19,16 +19,14 @@ export async function autopilotApiRequest(
|
||||
uri?: string,
|
||||
_option: IDataObject = {},
|
||||
): Promise<any> {
|
||||
const credentials = (await this.getCredentials('autopilotApi')) as IDataObject;
|
||||
|
||||
const apiKey = `${credentials.apiKey}`;
|
||||
const credentials = await this.getCredentials<{ apiKey: string }>('autopilotApi');
|
||||
|
||||
const endpoint = 'https://api2.autopilothq.com/v1';
|
||||
|
||||
const options: IRequestOptions = {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
autopilotapikey: apiKey,
|
||||
autopilotapikey: credentials.apiKey,
|
||||
},
|
||||
method,
|
||||
body,
|
||||
|
||||
Reference in New Issue
Block a user