fix: logs

This commit is contained in:
Charles GTE
2026-05-15 22:08:14 +02:00
parent 4f14d16452
commit 4e66b8ed04
4 changed files with 15 additions and 16 deletions
@@ -2,15 +2,15 @@
import {userAction} from "@/lib/safe-actions/actions";
import { logger } from "@/lib/logger";
const log = logger.child({ module: "dashboard/delete-project.action" });
import {z} from "zod";
import {v4 as uuidv4} from "uuid";
import {ServerActionResult} from "@/types/action-type";
import {and, eq, inArray} from "drizzle-orm";
import {eq, inArray} from "drizzle-orm";
import {db} from "@/db";
import * as drizzleDb from "@/db";
const log = logger.child({ module: "dashboard/delete-project.action" });
export const deleteProjectAction = userAction.schema(z.string()).action(async ({parsedInput}): Promise<ServerActionResult<typeof drizzleDb.schemas.project.$inferSelect>> => {
try {
const uuid = uuidv4();
+4 -6
View File
@@ -1,8 +1,6 @@
"use server";
import {userAction} from "@/lib/safe-actions/actions";
import { logger } from "@/lib/logger";
const log = logger.child({ module: "features/upload/upload.action" });
import {logger} from "@/lib/logger";
import {z} from "zod";
import {v4 as uuidv4} from "uuid";
import {db} from "@/db";
@@ -13,6 +11,7 @@ import {dispatchStorage} from "@/features/storages/dispatch";
import {StorageInput} from "@/features/storages/types";
import sharp from "sharp";
const log = logger.child({module: "features/upload/upload.action"});
export const uploadUserImageAction = userAction.schema(
z.instanceof(FormData)
@@ -30,7 +29,7 @@ export const uploadUserImageAction = userAction.schema(
const isWebp = fileFormat === "webp";
const compressedBuffer = await sharp(buffer)
.resize({ width: 1024 })
.resize({width: 1024})
.toFormat(isPng ? "png" : isWebp ? "webp" : "jpeg", {
quality: 80,
compressionLevel: isPng ? 9 : undefined
@@ -38,7 +37,6 @@ export const uploadUserImageAction = userAction.schema(
.toBuffer();
const settings = await db.query.setting.findFirst({
where: eq(drizzleDb.schemas.setting.name, "system"),
with: {
@@ -72,7 +70,7 @@ export const uploadUserImageAction = userAction.schema(
}
const result = await dispatchStorage(input, undefined, settings.storageChannel.id);
log.debug({ result }, "Upload dispatch result");
log.debug({result}, "Upload dispatch result");
if (!result.success) {
return {
success: false,
+1 -1
View File
@@ -132,7 +132,7 @@ async function createDefaultOrganization() {
}
function consoleAscii() {
log.info(
console.log(
" \n" +
" ____ __ __ \n" +
" / __ \\____ _____/ /_____ _/ /_ ____ _________ \n" +