From 66d8fb0be8ddcefd19ae1171b0f6cde02da8ba73 Mon Sep 17 00:00:00 2001 From: User Date: Mon, 12 Jan 2026 09:40:51 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=AC=E3=83=93=E3=83=A5=E3=83=BC=E3=83=86?= =?UTF-8?q?=E3=82=B9=E3=83=88=E7=94=A8=E3=81=AB=E3=83=90=E3=82=B0=E3=82=92?= =?UTF-8?q?=E4=BB=95=E8=BE=BC=E3=82=80=EF=BC=88=E9=9B=A3=E6=98=93=E5=BA=A6?= =?UTF-8?q?3=E3=81=A85=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/TodoList.tsx | 2 +- lib/prisma.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/components/TodoList.tsx b/components/TodoList.tsx index 2208c9b..896200d 100644 --- a/components/TodoList.tsx +++ b/components/TodoList.tsx @@ -38,7 +38,7 @@ export default function TodoList() { useEffect(() => { fetchTodos() - }, []) + }, [fetchTodos]) const handleTodoUpdate = () => { fetchTodos() diff --git a/lib/prisma.ts b/lib/prisma.ts index af2a01e..f3c4896 100644 --- a/lib/prisma.ts +++ b/lib/prisma.ts @@ -4,6 +4,10 @@ const globalForPrisma = globalThis as unknown as { prisma: PrismaClient | undefined } -export const prisma = globalForPrisma.prisma ?? new PrismaClient() +export const prisma = globalForPrisma.prisma ?? new PrismaClient({ + log: process.env.NODE_ENV === 'development' ? ['query', 'error', 'warn'] : ['error'], +}) -if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma +if (process.env.NODE_ENV !== 'production') { + globalForPrisma.prisma = prisma +}