mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix(Discourse Node): Fix issue with not all posts getting returned and add credential test (#3007)
* 🔨 fix for not all posts returning * ⚡ added credential test * ⚡ Improvements * ⚡ Improvements * ⚡ Define test the new way * ⚡ Remove not needed imports * ⚡ Fix auth test problem Co-authored-by: ricardo <ricardoespinoza105@gmail.com> Co-authored-by: Ricardo Espinoza <ricardo@n8n.io> Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
import {
|
||||
ICredentialDataDecryptedObject,
|
||||
ICredentialTestRequest,
|
||||
ICredentialType,
|
||||
IHttpRequestOptions,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
@@ -30,4 +33,25 @@ export class DiscourseApi implements ICredentialType {
|
||||
default: '',
|
||||
},
|
||||
];
|
||||
|
||||
async authenticate(credentials: ICredentialDataDecryptedObject, requestOptions: IHttpRequestOptions): Promise<IHttpRequestOptions> {
|
||||
requestOptions.headers = {
|
||||
'Api-Key': credentials.apiKey,
|
||||
'Api-Username': credentials.username,
|
||||
};
|
||||
|
||||
if (requestOptions.method === 'GET') {
|
||||
delete requestOptions.body;
|
||||
}
|
||||
|
||||
return requestOptions;
|
||||
}
|
||||
|
||||
test: ICredentialTestRequest = {
|
||||
request: {
|
||||
baseURL: '={{$credentials.url}}',
|
||||
url: '/admin/groups.json',
|
||||
method: 'GET',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user