From fe36da30a67d1f3aaf43b72f3a03d4dd075c0854 Mon Sep 17 00:00:00 2001 From: kensiiwasaki Date: Thu, 23 Nov 2023 22:41:38 +0900 Subject: [PATCH] =?UTF-8?q?modify:=20prisma=E3=83=95=E3=82=A1=E3=82=A4?= =?UTF-8?q?=E3=83=AB=E3=82=A4=E3=83=B3=E3=83=9D=E3=83=BC=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/routes/index.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/routes/index.tsx b/app/routes/index.tsx index 00a1590..87b5ec1 100644 --- a/app/routes/index.tsx +++ b/app/routes/index.tsx @@ -12,6 +12,7 @@ import type { ActionFunction, LoaderFunction } from "@remix-run/node"; import { json } from "@remix-run/node"; import { Form, Link, useActionData, useNavigation } from "@remix-run/react"; import { OpenAI } from "openai"; +import { findAllTask } from "~/datasource/prisma/task"; import { NormalPrompt } from "~/util/prompt"; const prisma = new PrismaClient(); @@ -20,9 +21,7 @@ export const loader: LoaderFunction = (args) => { return rootAuthLoader(args, async ({ request }) => { const { userId } = request.auth; - const tasks = userId - ? await prisma.task.findMany({ where: { userId } }) - : []; + const tasks = userId ? await findAllTask(userId) : []; return json({ tasks }); });