mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix: Issue with credentials and workflows not being matched correctly due to incorrect typing (#5011)
* fix: Always return ids as strings
This commit is contained in:
@@ -35,7 +35,13 @@ EECredentialsController.get(
|
|||||||
});
|
});
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||||
return allCredentials.map(EECredentials.addOwnerAndSharings);
|
return allCredentials
|
||||||
|
.map((credential: CredentialsEntity & CredentialWithSharings) =>
|
||||||
|
EECredentials.addOwnerAndSharings(credential),
|
||||||
|
)
|
||||||
|
.map(
|
||||||
|
(credential): CredentialWithSharings => ({ ...credential, id: credential.id.toString() }),
|
||||||
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
LoggerProxy.error('Request to list credentials failed', error as Error);
|
LoggerProxy.error('Request to list credentials failed', error as Error);
|
||||||
throw error;
|
throw error;
|
||||||
|
|||||||
@@ -3,12 +3,9 @@
|
|||||||
import express from 'express';
|
import express from 'express';
|
||||||
import {
|
import {
|
||||||
deepCopy,
|
deepCopy,
|
||||||
ICredentialType,
|
|
||||||
INodeCredentialTestResult,
|
INodeCredentialTestResult,
|
||||||
LoggerProxy,
|
LoggerProxy,
|
||||||
NodeHelpers,
|
|
||||||
} from 'n8n-workflow';
|
} from 'n8n-workflow';
|
||||||
import { Credentials } from 'n8n-core';
|
|
||||||
|
|
||||||
import * as GenericHelpers from '@/GenericHelpers';
|
import * as GenericHelpers from '@/GenericHelpers';
|
||||||
import { InternalHooksManager } from '@/InternalHooksManager';
|
import { InternalHooksManager } from '@/InternalHooksManager';
|
||||||
@@ -17,7 +14,6 @@ import config from '@/config';
|
|||||||
import { getLogger } from '@/Logger';
|
import { getLogger } from '@/Logger';
|
||||||
import { EECredentialsController } from './credentials.controller.ee';
|
import { EECredentialsController } from './credentials.controller.ee';
|
||||||
import { CredentialsService } from './credentials.service';
|
import { CredentialsService } from './credentials.service';
|
||||||
import { CredentialTypes } from '@/CredentialTypes';
|
|
||||||
|
|
||||||
import type { ICredentialsResponse } from '@/Interfaces';
|
import type { ICredentialsResponse } from '@/Interfaces';
|
||||||
import type { CredentialRequest } from '@/requests';
|
import type { CredentialRequest } from '@/requests';
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ EEWorkflowController.get(
|
|||||||
|
|
||||||
EEWorkflows.addOwnerAndSharings(workflow);
|
EEWorkflows.addOwnerAndSharings(workflow);
|
||||||
await EEWorkflows.addCredentialsToWorkflow(workflow, req.user);
|
await EEWorkflows.addCredentialsToWorkflow(workflow, req.user);
|
||||||
return workflow;
|
return { ...workflow, id: workflow.id.toString() };
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -214,7 +214,7 @@ EEWorkflowController.get(
|
|||||||
EEWorkflows.addOwnerAndSharings(workflow);
|
EEWorkflows.addOwnerAndSharings(workflow);
|
||||||
await EEWorkflows.addCredentialsToWorkflow(workflow, req.user);
|
await EEWorkflows.addCredentialsToWorkflow(workflow, req.user);
|
||||||
workflow.nodes = [];
|
workflow.nodes = [];
|
||||||
return workflow;
|
return { ...workflow, id: workflow.id.toString() };
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user