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

View File

@@ -1,25 +1,23 @@
import { Knex } from "knex";
import { TableName } from "../schemas";
import { TableName } from "@app/db/schemas";
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) {
await knex.schema.alterTable(TableName.SecretFolder, (t) => {
t.string("description");
});
}
if (!hasProjectDescription) {
await knex.schema.alterTable(TableName.SecretFolder, (t) => {
t.string("description");
});
}
}
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) {
await knex.schema.alterTable(TableName.SecretFolder, (t) => {
t.dropColumn("description");
});
}
if (hasProjectDescription) {
await knex.schema.alterTable(TableName.SecretFolder, (t) => {
t.dropColumn("description");
});
}
}

View File

@@ -129,7 +129,7 @@ export const registerSecretFolderRouter = async (server: FastifyZodProvider) =>
.transform(prefixWithSlash)
.transform(removeTrailingSlash)
.describe(FOLDERS.UPDATE.directory),
description: z.string().optional().describe(FOLDERS.UPDATE.description),
description: z.string().optional().describe(FOLDERS.UPDATE.description)
}),
response: {
200: z.object({
@@ -148,7 +148,7 @@ export const registerSecretFolderRouter = async (server: FastifyZodProvider) =>
...req.body,
projectId: req.body.workspaceId,
id: req.params.folderId,
path,
path
});
await server.services.auditLog.createAuditLog({
...req.auditLogInfo,
@@ -201,7 +201,7 @@ export const registerSecretFolderRouter = async (server: FastifyZodProvider) =>
.transform(prefixWithSlash)
.transform(removeTrailingSlash)
.describe(FOLDERS.UPDATE.path),
description: z.string().optional().describe(FOLDERS.UPDATE.description),
description: z.string().optional().describe(FOLDERS.UPDATE.description)
})
.array()
.min(1)

View File

@@ -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(
{
name: doc.name,

View File

@@ -9,7 +9,7 @@ export type TCreateFolderDTO = {
environment: string;
path: string;
name: string;
description?: string;
description?: string;
} & TProjectPermission;
export type TUpdateFolderDTO = {
@@ -17,7 +17,7 @@ export type TUpdateFolderDTO = {
path: string;
id: string;
name: string;
description?: string;
description?: string;
} & TProjectPermission;
export type TUpdateManyFoldersDTO = {
@@ -27,7 +27,7 @@ export type TUpdateManyFoldersDTO = {
path: string;
id: string;
name: string;
description?: string;
description?: string;
}[];
} & Omit<TProjectPermission, "projectId">;