mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
refactor(core): Continue moving typeorm operators to repositories (no-changelog) (#8212)
Follow-up to: https://github.com/n8n-io/n8n/pull/8186
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { In } from 'typeorm';
|
||||
import { User } from '@db/entities/User';
|
||||
import { SharedCredentials } from '@db/entities/SharedCredentials';
|
||||
import { SharedWorkflow } from '@db/entities/SharedWorkflow';
|
||||
@@ -214,10 +213,11 @@ export class UsersController {
|
||||
|
||||
// Prevents issues with unique key constraints since user being assigned
|
||||
// workflows and credentials might be a sharee
|
||||
await transactionManager.delete(SharedWorkflow, {
|
||||
user: transferee,
|
||||
workflowId: In(sharedWorkflowIds),
|
||||
});
|
||||
await this.sharedWorkflowRepository.deleteByIds(
|
||||
transactionManager,
|
||||
sharedWorkflowIds,
|
||||
transferee,
|
||||
);
|
||||
|
||||
// Transfer ownership of owned workflows
|
||||
await transactionManager.update(
|
||||
@@ -239,10 +239,11 @@ export class UsersController {
|
||||
|
||||
// Prevents issues with unique key constraints since user being assigned
|
||||
// workflows and credentials might be a sharee
|
||||
await transactionManager.delete(SharedCredentials, {
|
||||
user: transferee,
|
||||
credentialsId: In(sharedCredentialIds),
|
||||
});
|
||||
await this.sharedCredentialsRepository.deleteByIds(
|
||||
transactionManager,
|
||||
sharedCredentialIds,
|
||||
transferee,
|
||||
);
|
||||
|
||||
// Transfer ownership of owned credentials
|
||||
await transactionManager.update(
|
||||
|
||||
Reference in New Issue
Block a user