chore(server): core IoC 12 - remaining branches repo

This commit is contained in:
Kristaps Fabians Geikins
2024-09-27 13:52:41 +03:00
parent e860ec11e1
commit 9dbde37438
8 changed files with 151 additions and 96 deletions
@@ -22,7 +22,7 @@ import { CommitRecord } from '@/modules/core/helpers/types'
import {
getBranchByIdFactory,
getStreamBranchByNameFactory,
markCommitBranchUpdated
markCommitBranchUpdatedFactory
} from '@/modules/core/repositories/branches'
import {
createCommit,
@@ -133,7 +133,7 @@ export async function createCommitByBranchId(
await Promise.all([
markCommitStreamUpdated(id),
markCommitBranchUpdated(id),
markCommitBranchUpdatedFactory({ db })(id),
VersionsEmitter.emit(VersionEvents.Created, {
projectId: streamId,
modelId: branchId,
@@ -309,7 +309,7 @@ export async function updateCommitAndNotify(
await Promise.all([
markCommitStreamUpdated(commit.id),
markCommitBranchUpdated(commit.id)
markCommitBranchUpdatedFactory({ db })(commit.id)
])
}
@@ -336,7 +336,7 @@ export async function deleteCommitAndNotify(
const [, updatedBranch] = await Promise.all([
markCommitStreamUpdated(commit.id),
markCommitBranchUpdated(commit.id)
markCommitBranchUpdatedFactory({ db })(commit.id)
])
const isDeleted = await deleteCommit(commitId)