refactor(core): Move more typeorm operators to repositories (no-changelog) (#8143)
Follow-up to #8139
This commit is contained in:
@@ -14,6 +14,7 @@ import type { CredentialsEntity } from '@db/entities/CredentialsEntity';
|
||||
import { BadRequestError } from '@/errors/response-errors/bad-request.error';
|
||||
import { NotFoundError } from '@/errors/response-errors/not-found.error';
|
||||
import { UnauthorizedError } from '@/errors/response-errors/unauthorized.error';
|
||||
import { CredentialsRepository } from '@/databases/repositories/credentials.repository';
|
||||
|
||||
export const EECredentialsController = express.Router();
|
||||
|
||||
@@ -155,10 +156,11 @@ EECredentialsController.put(
|
||||
let newShareeIds: string[] = [];
|
||||
await Db.transaction(async (trx) => {
|
||||
// remove all sharings that are not supposed to exist anymore
|
||||
const { affected } = await EECredentials.pruneSharings(trx, credentialId, [
|
||||
...ownerIds,
|
||||
...shareWithIds,
|
||||
]);
|
||||
const { affected } = await Container.get(CredentialsRepository).pruneSharings(
|
||||
trx,
|
||||
credentialId,
|
||||
[...ownerIds, ...shareWithIds],
|
||||
);
|
||||
if (affected) amountRemoved = affected;
|
||||
|
||||
const sharings = await EECredentials.getSharings(trx, credentialId);
|
||||
|
||||
Reference in New Issue
Block a user