Lint fixes

This commit is contained in:
carlosmonastyrski
2025-03-04 10:44:26 -03:00
parent b023bc7442
commit 4eba80905a
4 changed files with 23 additions and 22 deletions
@@ -1,25 +1,23 @@
import { Knex } from "knex"; import { Knex } from "knex";
import { TableName } from "../schemas"; import { TableName } from "@app/db/schemas";
export async function up(knex: Knex): Promise<void> { export async function up(knex: Knex): Promise<void> {
const hasProjectDescription = await knex.schema.hasColumn(TableName.SecretFolder, "description"); const hasProjectDescription = await knex.schema.hasColumn(TableName.SecretFolder, "description");
if (!hasProjectDescription) { if (!hasProjectDescription) {
await knex.schema.alterTable(TableName.SecretFolder, (t) => { await knex.schema.alterTable(TableName.SecretFolder, (t) => {
t.string("description"); t.string("description");
}); });
} }
} }
export async function down(knex: Knex): Promise<void> { export async function down(knex: Knex): Promise<void> {
const hasProjectDescription = await knex.schema.hasColumn(TableName.SecretFolder, "description"); const hasProjectDescription = await knex.schema.hasColumn(TableName.SecretFolder, "description");
if (hasProjectDescription) { if (hasProjectDescription) {
await knex.schema.alterTable(TableName.SecretFolder, (t) => { await knex.schema.alterTable(TableName.SecretFolder, (t) => {
t.dropColumn("description"); t.dropColumn("description");
}); });
} }
} }
@@ -129,7 +129,7 @@ export const registerSecretFolderRouter = async (server: FastifyZodProvider) =>
.transform(prefixWithSlash) .transform(prefixWithSlash)
.transform(removeTrailingSlash) .transform(removeTrailingSlash)
.describe(FOLDERS.UPDATE.directory), .describe(FOLDERS.UPDATE.directory),
description: z.string().optional().describe(FOLDERS.UPDATE.description), description: z.string().optional().describe(FOLDERS.UPDATE.description)
}), }),
response: { response: {
200: z.object({ 200: z.object({
@@ -148,7 +148,7 @@ export const registerSecretFolderRouter = async (server: FastifyZodProvider) =>
...req.body, ...req.body,
projectId: req.body.workspaceId, projectId: req.body.workspaceId,
id: req.params.folderId, id: req.params.folderId,
path, path
}); });
await server.services.auditLog.createAuditLog({ await server.services.auditLog.createAuditLog({
...req.auditLogInfo, ...req.auditLogInfo,
@@ -201,7 +201,7 @@ export const registerSecretFolderRouter = async (server: FastifyZodProvider) =>
.transform(prefixWithSlash) .transform(prefixWithSlash)
.transform(removeTrailingSlash) .transform(removeTrailingSlash)
.describe(FOLDERS.UPDATE.path), .describe(FOLDERS.UPDATE.path),
description: z.string().optional().describe(FOLDERS.UPDATE.description), description: z.string().optional().describe(FOLDERS.UPDATE.description)
}) })
.array() .array()
.min(1) .min(1)
@@ -122,7 +122,10 @@ export const secretFolderServiceFactory = ({
} }
} }
const doc = await folderDAL.create({ name, envId: env.id, version: 1, parentId: parentFolderId, description }, tx); const doc = await folderDAL.create(
{ name, envId: env.id, version: 1, parentId: parentFolderId, description },
tx
);
await folderVersionDAL.create( await folderVersionDAL.create(
{ {
name: doc.name, name: doc.name,
@@ -9,7 +9,7 @@ export type TCreateFolderDTO = {
environment: string; environment: string;
path: string; path: string;
name: string; name: string;
description?: string; description?: string;
} & TProjectPermission; } & TProjectPermission;
export type TUpdateFolderDTO = { export type TUpdateFolderDTO = {
@@ -17,7 +17,7 @@ export type TUpdateFolderDTO = {
path: string; path: string;
id: string; id: string;
name: string; name: string;
description?: string; description?: string;
} & TProjectPermission; } & TProjectPermission;
export type TUpdateManyFoldersDTO = { export type TUpdateManyFoldersDTO = {
@@ -27,7 +27,7 @@ export type TUpdateManyFoldersDTO = {
path: string; path: string;
id: string; id: string;
name: string; name: string;
description?: string; description?: string;
}[]; }[];
} & Omit<TProjectPermission, "projectId">; } & Omit<TProjectPermission, "projectId">;