refactor(core): Migrate DB setup to use DI (#15324)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2025-05-13 13:28:41 +02:00
committed by GitHub
parent c061acc01c
commit 8591c2e0d1
35 changed files with 782 additions and 378 deletions

View File

@@ -26,7 +26,6 @@ import { deepCopy } from 'n8n-workflow';
import type { ICredentialDataDecryptedObject } from 'n8n-workflow';
import { z } from 'zod';
import * as Db from '@/db';
import { BadRequestError } from '@/errors/response-errors/bad-request.error';
import { ForbiddenError } from '@/errors/response-errors/forbidden.error';
import { NotFoundError } from '@/errors/response-errors/not-found.error';
@@ -317,7 +316,8 @@ export class CredentialsController {
let amountRemoved: number | null = null;
let newShareeIds: string[] = [];
await Db.transaction(async (trx) => {
const { manager: dbManager } = this.sharedCredentialsRepository;
await dbManager.transaction(async (trx) => {
const currentProjectIds = credential.shared
.filter((sc) => sc.role === 'credential:user')
.map((sc) => sc.projectId);