Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
Add transaction support
Daniel Hougaardec3cf0208c7f
diff --git a/backend/src/services/project/project-dal.ts b/backend/src/services/project/project-dal.tsindex a9906f8597..c85d67ee19 100644--- a/backend/src/services/project/project-dal.ts+++ b/backend/src/services/project/project-dal.ts@@ -1,3 +1,5 @@+import { Knex } from "knex";+import { TDbClient } from "@app/db";import { ProjectsSchema, ProjectUpgradeStatus, TableName, TProjectsUpdate } from "@app/db/schemas";import { DatabaseError } from "@app/lib/errors";@@ -66,13 +68,13 @@ export const projectDALFactory = (db: TDbClient) => {}};- const setProjectUpgradeStatus = async (projectId: string, status: ProjectUpgradeStatus) => {+ const setProjectUpgradeStatus = async (projectId: string, status: ProjectUpgradeStatus | null, tx?: Knex) => {try {const data: TProjectsUpdate = {upgradeStatus: status} as const;- await db(TableName.Project).where({ id: projectId }).update(data);+ await (tx || db)(TableName.Project).where({ id: projectId }).update(data);} catch (error) {throw new DatabaseError({ error, name: "Set project upgrade status" });}