mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 04:04:06 -08:00
⚡ Simplify
This commit is contained in:
parent
db3e0fb422
commit
1d8e800620
|
@ -156,12 +156,8 @@ export class Jira implements INodeType {
|
||||||
methods = {
|
methods = {
|
||||||
credentialTest: {
|
credentialTest: {
|
||||||
async jiraSoftwareApiTest(this: ICredentialTestFunctions, credential: ICredentialsDecrypted): Promise<NodeCredentialTestResult> {
|
async jiraSoftwareApiTest(this: ICredentialTestFunctions, credential: ICredentialsDecrypted): Promise<NodeCredentialTestResult> {
|
||||||
let data; let domain;
|
|
||||||
const credentials = credential.data;
|
const credentials = credential.data;
|
||||||
domain = credentials!.domain;
|
const data = Buffer.from(`${credentials!.email}:${credentials!.password || credentials!.apiToken}`).toString('base64');
|
||||||
data = Buffer.from(`${credentials!.email}:${credentials!.password || credentials!.apiToken}`).toString('base64');
|
|
||||||
|
|
||||||
const endpoint = '/api/2/project';
|
|
||||||
|
|
||||||
const options: OptionsWithUri = {
|
const options: OptionsWithUri = {
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -171,7 +167,7 @@ export class Jira implements INodeType {
|
||||||
'X-Atlassian-Token': 'no-check',
|
'X-Atlassian-Token': 'no-check',
|
||||||
},
|
},
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
uri: `${domain}/rest${endpoint}`,
|
uri: `${credentials!.domain}/rest/api/2/project`,
|
||||||
qs: {
|
qs: {
|
||||||
recent: 0,
|
recent: 0,
|
||||||
},
|
},
|
||||||
|
@ -179,7 +175,7 @@ export class Jira implements INodeType {
|
||||||
timeout: 5000,
|
timeout: 5000,
|
||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
const response = await this.helpers.request!(options);
|
await this.helpers.request!(options);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return {
|
return {
|
||||||
status: 'Error',
|
status: 'Error',
|
||||||
|
|
Loading…
Reference in a new issue