mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-12 04:29:09 +00:00
fix: update create org to properly handle tx (super admin), remove sub org incidents, remove clipping animation container for project templates ui
This commit is contained in:
@@ -284,7 +284,7 @@ export const licenseServiceFactory = ({
|
||||
};
|
||||
|
||||
const updateSubscriptionOrgMemberCount = async (orgId: string, tx?: Knex) => {
|
||||
const org = await orgDAL.findRootOrgDetails(orgId);
|
||||
const org = await orgDAL.findRootOrgDetails(orgId, tx);
|
||||
if (!org) throw new NotFoundError({ message: `Organization with ID '${orgId}' not found` });
|
||||
|
||||
const rootOrgId = org.id;
|
||||
|
||||
@@ -705,10 +705,9 @@ export const orgDALFactory = (db: TDbClient) => {
|
||||
}
|
||||
};
|
||||
|
||||
const findRootOrgDetails = async (orgId: string): Promise<TOrganizations | undefined> => {
|
||||
const findRootOrgDetails = async (orgId: string, tx?: Knex): Promise<TOrganizations | undefined> => {
|
||||
try {
|
||||
const org = await db
|
||||
.replicaNode()(TableName.Organization)
|
||||
const org = await (tx ?? db.replicaNode())(TableName.Organization)
|
||||
.select(selectAllTableCols(TableName.Organization))
|
||||
.where(
|
||||
"id",
|
||||
|
||||
@@ -679,7 +679,7 @@ export const orgServiceFactory = ({
|
||||
|
||||
const organization = await (trx ? createOrg(trx) : orgDAL.transaction(createOrg));
|
||||
|
||||
await licenseService.updateSubscriptionOrgMemberCount(organization.id);
|
||||
await licenseService.updateSubscriptionOrgMemberCount(organization.id, trx);
|
||||
return organization;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user