Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix(org): resolve lint errors in org DAL, schema, service and types

Igor Correa0d069decd60e
diff --git a/backend/src/services/org/org-dal.ts b/backend/src/services/org/org-dal.ts
index 44e534e1ff..5415858436 100644
--- a/backend/src/services/org/org-dal.ts
+++ b/backend/src/services/org/org-dal.ts
@@ -14,7 +14,7 @@ import {
TOrganizationsInsert,
TUserEncryptionKeys
} from "@app/db/schemas";
-import { BadRequestError, DatabaseError } from "@app/lib/errors";
+import { DatabaseError } from "@app/lib/errors";
import { groupBy } from "@app/lib/fn";
import {
buildFindFilter,
@@ -28,8 +28,7 @@ import {
import { generateKnexQueryFromScim } from "@app/lib/knex/scim";
import { ActorType } from "../auth/auth-type";
-import { TOrgWithSubOrgs } from "./org-types";
-import { OrgAuthMethod } from "./org-types";
+import { OrgAuthMethod, TOrgWithSubOrgs } from "./org-types";
export type TOrgDALFactory = ReturnType<typeof orgDALFactory>;
@@ -236,9 +235,7 @@ export const orgDALFactory = (db: TDbClient) => {
* Returns all root orgs the actor can see (has membership, direct or via group),
* each with its sub-organizations. Basic org fields and suborg id/name/slug only.
*/
- const listOrganizationsWithSubOrgs = async (dto: {
- actorId: string;
- }): Promise<TOrgWithSubOrgs[]> => {
+ const listOrganizationsWithSubOrgs = async (dto: { actorId: string }): Promise<TOrgWithSubOrgs[]> => {
try {
const conn = db.replicaNode();
@@ -258,9 +255,7 @@ export const orgDALFactory = (db: TDbClient) => {
.andOn(`access_m.scope`, db.raw("?", [AccessScope.Organization]));
})
.where((qb) => {
- void qb
- .where(`access_m.actorUserId`, dto.actorId)
- .orWhereIn(`access_m.actorGroupId`, userGroupIdsSubquery);
+ void qb.where(`access_m.actorUserId`, dto.actorId).orWhereIn(`access_m.actorGroupId`, userGroupIdsSubquery);
})
.leftJoin(`${TableName.Membership} as direct_m`, (qb) => {
void qb
diff --git a/backend/src/services/org/org-schema.ts b/backend/src/services/org/org-schema.ts
index 2a5ff0c77c..b42f822f07 100644
--- a/backend/src/services/org/org-schema.ts
+++ b/backend/src/services/org/org-schema.ts
@@ -2,13 +2,6 @@ import { z } from "zod";
import { OrganizationsSchema } from "@app/db/schemas";
-/** Minimal org fields (id, name, slug) – e.g. for sub-org list items or summaries */
-const orgBasicSchema = OrganizationsSchema.pick({
- id: true,
- name: true,
- slug: true
-});
-
/** Zod schema for API response: org with sub-orgs */
export const OrgWithSubOrgsSchema = OrganizationsSchema.pick({
id: true,
diff --git a/backend/src/services/org/org-service.ts b/backend/src/services/org/org-service.ts
index 1e2d02169a..59006e787f 100644
--- a/backend/src/services/org/org-service.ts
+++ b/backend/src/services/org/org-service.ts
@@ -60,7 +60,6 @@ import { TUserDALFactory } from "../user/user-dal";
import { TIncidentContactsDALFactory } from "./incident-contacts-dal";
import { TOrgDALFactory } from "./org-dal";
import { deleteOrgMembershipsFn } from "./org-fns";
-import { TOrgWithSubOrgs } from "./org-types";
import {
TDeleteOrgMembershipDTO,
TDeleteOrgMembershipsDTO,
@@ -71,6 +70,7 @@ import {
TGetOrgMembershipDTO,
TListProjectMembershipsByOrgMembershipIdDTO,
TResendOrgMemberInvitationDTO,
+ TOrgWithSubOrgs,
TUpdateOrgDTO,
TUpdateOrgMembershipDTO,
TUpgradePrivilegeSystemDTO,
diff --git a/backend/src/services/org/org-types.ts b/backend/src/services/org/org-types.ts
index 923ab29566..6fa3f15950 100644
--- a/backend/src/services/org/org-types.ts
+++ b/backend/src/services/org/org-types.ts
@@ -3,7 +3,6 @@ import { z } from "zod";
import { TOrgPermission } from "@app/lib/types";
import { ActorAuthMethod, ActorType, MfaMethod } from "../auth/auth-type";
-
import { OrgWithSubOrgsSchema } from "./org-schema";
/** Root org with accessible sub-orgs (basic info only) */