fix(core): fix predefinedCredentialType in node graph item (#4379)

* 🐛 Fix predefined cred in node graph item

* 🔥 Remove logging
This commit is contained in:
Iván Ovejero 2022-10-25 09:07:26 +02:00 committed by GitHub
parent d2b97c0713
commit 77233f2370
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -171,13 +171,13 @@ export function generateNodesGraph(
} catch (_) {
nodeItem.domain = getDomainBase(node.parameters.url as string);
}
} else if (node.type === 'n8n-nodes-base.httpRequest' && node.typeVersion === 2) {
} else if (node.type === 'n8n-nodes-base.httpRequest' && [2, 3].includes(node.typeVersion)) {
const { authentication } = node.parameters as { authentication: string };
nodeItem.credential_type = {
none: 'none',
genericCredentialType: node.parameters.genericAuthType as string,
existingCredentialType: node.parameters.nodeCredentialType as string,
predefinedCredentialType: node.parameters.nodeCredentialType as string,
}[authentication];
nodeItem.credential_set = node.credentials