[autofix.ci] apply automated fixes

This commit is contained in:
autofix-ci[bot]
2026-03-15 22:43:40 +00:00
committed by GitHub
parent 8127dc4536
commit 5410a56638
8 changed files with 321 additions and 275 deletions

View File

@@ -125,7 +125,9 @@ export const member = pgTable("member", {
userId: text("user_id")
.notNull()
.references(() => user.id, { onDelete: "cascade" }),
role: text("role").notNull().$type<"owner" | "member" | "admin" | (string & {})>(),
role: text("role")
.notNull()
.$type<"owner" | "member" | "admin" | (string & {})>(),
createdAt: timestamp("created_at").notNull(),
teamId: text("team_id"),
isDefault: boolean("is_default").notNull().default(false),

View File

@@ -265,10 +265,7 @@ export const checkServiceAccess = async (
await checkPermission(ctx, { service: [action] });
if (
memberRecord.role !== "owner" &&
memberRecord.role !== "admin"
) {
if (memberRecord.role !== "owner" && memberRecord.role !== "admin") {
if (action === "create") {
if (!memberRecord.accessedProjects.includes(serviceId)) {
throw new TRPCError({
@@ -352,10 +349,7 @@ export const checkEnvironmentDeletionPermission = async (
}
};
export const addNewProject = async (
ctx: PermissionCtx,
projectId: string,
) => {
export const addNewProject = async (ctx: PermissionCtx, projectId: string) => {
const userId = ctx.user.id;
const organizationId = ctx.session.activeOrganizationId;
const memberRecord = await findMemberByUserId(userId, organizationId);
@@ -395,10 +389,7 @@ export const addNewEnvironment = async (
);
};
export const addNewService = async (
ctx: PermissionCtx,
serviceId: string,
) => {
export const addNewService = async (ctx: PermissionCtx, serviceId: string) => {
const userId = ctx.user.id;
const organizationId = ctx.session.activeOrganizationId;
const memberRecord = await findMemberByUserId(userId, organizationId);

View File

@@ -74,7 +74,8 @@ export const getAuditLogs = async (input: GetAuditLogsInput) => {
if (userId) conditions.push(eq(auditLog.userId, userId));
if (userEmail) conditions.push(ilike(auditLog.userEmail, `%${userEmail}%`));
if (resourceName) conditions.push(ilike(auditLog.resourceName, `%${resourceName}%`));
if (resourceName)
conditions.push(ilike(auditLog.resourceName, `%${resourceName}%`));
if (action) conditions.push(eq(auditLog.action, action));
if (resourceType) conditions.push(eq(auditLog.resourceType, resourceType));
if (from) conditions.push(gte(auditLog.createdAt, from));