From b795723a42e300c98778bd2c20ee202b51ad514c Mon Sep 17 00:00:00 2001 From: Imhwitae Date: Thu, 4 Dec 2025 16:23:06 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20metadata=EB=A1=9C=20=EC=9D=B8?= =?UTF-8?q?=ED=95=B4=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=ED=91=9C=EC=B6=9C=20?= =?UTF-8?q?=EB=8A=90=EB=A0=A4=EC=A7=80=EB=8A=94=20=EB=B6=80=EB=B6=84=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/[groupId]/tasklist/layout.tsx | 10 ++++ src/app/[groupId]/tasklist/page.tsx | 77 --------------------------- 2 files changed, 10 insertions(+), 77 deletions(-) diff --git a/src/app/[groupId]/tasklist/layout.tsx b/src/app/[groupId]/tasklist/layout.tsx index 01e61592..537403b0 100644 --- a/src/app/[groupId]/tasklist/layout.tsx +++ b/src/app/[groupId]/tasklist/layout.tsx @@ -1,5 +1,15 @@ +import { Metadata } from "next"; import { ReactNode } from "react"; +export const metadata: Metadata = { + title: "할 일 목록", + description: "할 일을 확인할 수 있습니다.", + robots: { + index: false, + follow: false, + }, +}; + const Layout = ({ children, task, diff --git a/src/app/[groupId]/tasklist/page.tsx b/src/app/[groupId]/tasklist/page.tsx index 61a67257..78b580d0 100644 --- a/src/app/[groupId]/tasklist/page.tsx +++ b/src/app/[groupId]/tasklist/page.tsx @@ -1,81 +1,4 @@ -import { Metadata } from "next"; import TaskList from "./_components/task-list"; -import { cookies } from "next/headers"; -import { fetchTaskList } from "@/api/task/get-task-list"; -import { fetchTaskDetail } from "@/api/task/get-task-detail"; - -export const generateMetadata = async ({ - params, - searchParams, -}: { - params: Promise<{ groupId: string }>; - searchParams: Promise<{ list: string; task: string | undefined }>; -}): Promise => { - const { groupId } = await params; - const { list, task } = await searchParams; - const cookieStore = await cookies(); - const token = cookieStore.get("accessToken")?.value; - - if (!token) { - return { - title: "할 일 목록", - description: "할 일을 확인할 수 있습니다.", - }; - } - - if (task) { - const taskDetail = await fetchTaskDetail( - Number(groupId), - Number(list), - Number(task), - token - ); - - return { - title: `${taskDetail.name ? taskDetail.name : "페이지를 찾을 수 없습니다."} - 할 일 상세`, - description: `${taskDetail.name ? `${taskDetail.name}의 상세 정보를 확인할 수 있습니다.` : "페이지를 찾을 수 없습니다."}`, - openGraph: { - title: `${taskDetail.name ? taskDetail.name : "페이지를 찾을 수 없습니다."} - 할 일 상세 | Coworkers`, - description: `${taskDetail.name ? `${taskDetail.name}의 상세 정보를 확인할 수 있습니다.` : "페이지를 찾을 수 없습니다."}`, - type: "website", - url: `https://coworkers-pied.vercel.app/${groupId}/tasklist?list=${list}&task=${task}`, - locale: "ko_KR", - siteName: "Coworkers", - images: [ - { - url: "https://sprint-fe-project.s3.ap-northeast-2.amazonaws.com/Coworkers/user/2449/open_graph.jpg", - width: 1200, - height: 630, - alt: "Coworkers", - }, - ], - }, - }; - } - - const response = await fetchTaskList(Number(groupId), Number(list), token); - - return { - title: `${response.name ? response.name : "할 일 목록 선택"} - 할 일 목록`, - description: `${response.name ? `${response.name}의 할 일을 확인할 수 있습니다.` : "페이지를 찾을 수 없습니다."}`, - openGraph: { - title: `${response.name ? response.name : "페이지를 찾을 수 없습니다."} - 할 일 목록 | Coworkers`, - description: `${response.name ? `${response.name}의 할 일을 확인할 수 있습니다.` : "페이지를 찾을 수 없습니다."}`, - type: "website", - url: `https://coworkers-pied.vercel.app/${groupId}/tasklist?list=${list}`, - locale: "ko_KR", - siteName: "Coworkers", - images: [ - { - url: "https://sprint-fe-project.s3.ap-northeast-2.amazonaws.com/Coworkers/user/2449/open_graph.jpg", - width: 1200, - height: 630, - alt: "Coworkers", - }, - ], - }, - }; -}; const Page = () => { return ; From 4a59e9d284b9c2cdd0b1c17cfd92aa3c937ff7ab Mon Sep 17 00:00:00 2001 From: Imhwitae Date: Thu, 4 Dec 2025 16:37:37 +0900 Subject: [PATCH 2/2] =?UTF-8?q?chore:=20=EC=BD=94=EB=93=9C=20=EC=A0=95?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/task/get-task-detail.ts | 27 --------------------------- src/api/task/get-task-list.ts | 24 ------------------------ 2 files changed, 51 deletions(-) diff --git a/src/api/task/get-task-detail.ts b/src/api/task/get-task-detail.ts index a1caef7c..a2009e20 100644 --- a/src/api/task/get-task-detail.ts +++ b/src/api/task/get-task-detail.ts @@ -1,31 +1,4 @@ import instance from "@/utils/axios"; -import { notFound } from "next/navigation"; - -export const fetchTaskDetail = async ( - groupId: number, - taskListId: number, - taskId: number, - token: string -) => { - try { - const response = await fetch( - `${process.env.NEXT_PUBLIC_API_URL}/groups/${groupId}/task-lists/${taskListId}/tasks/${taskId}`, - { - method: "GET", - headers: { - "Content-Type": "application/json", - Authorization: `Bearer ${token}`, - }, - } - ); - - if (response.status === 404) notFound(); - - return response.json(); - } catch (error) { - throw error; - } -}; /** * @author hwitae diff --git a/src/api/task/get-task-list.ts b/src/api/task/get-task-list.ts index 6f20036c..d87483e9 100644 --- a/src/api/task/get-task-list.ts +++ b/src/api/task/get-task-list.ts @@ -1,30 +1,6 @@ import { TaskList } from "@/types/taskList"; import instance from "@/utils/axios"; -export const fetchTaskList = async ( - groupId: number, - taskListId: number, - token: string -) => { - try { - const response = await fetch( - `${process.env.NEXT_PUBLIC_API_URL}/groups/${groupId}/task-lists/${taskListId}`, - { - method: "GET", - headers: { - "Content-Type": "application/json", - Authorization: `Bearer ${token}`, - }, - } - ); - - return response.json(); - } catch (error) { - console.error(error); - throw error; - } -}; - export const getTaskList = async ( groupId: number, taskListId: number,