diff --git a/src/app/(main)/calendar/page.tsx b/src/app/(main)/calendar/page.tsx index 3b654cb6..c9e421d9 100644 --- a/src/app/(main)/calendar/page.tsx +++ b/src/app/(main)/calendar/page.tsx @@ -1,5 +1,5 @@ import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query'; -import { todoQueries, goalQueries, userQueries } from '@/shared/lib/query/queryKeys'; +import { todoQueries, goalQueries, userQueries } from '@/shared/lib/query/queryFunction'; import CalendarClient from '@/features/calendar/components/CalendarClient'; import { DataBoundary } from '@/shared/components/ErrorSuspenseBoundary'; diff --git a/src/app/(main)/dashboard/all-todo/page.tsx b/src/app/(main)/dashboard/all-todo/page.tsx index 478b426a..512b2286 100644 --- a/src/app/(main)/dashboard/all-todo/page.tsx +++ b/src/app/(main)/dashboard/all-todo/page.tsx @@ -2,7 +2,7 @@ import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query import AllTodoContent from '@/features/dashboard/allTodo/components/AllTodoContent'; -import { todoQueries } from '@/shared/lib/query/queryKeys'; +import { todoQueries } from '@/shared/lib/query/queryFunction'; export const dynamic = 'force-dynamic'; diff --git a/src/app/(main)/dashboard/favorite-todo/page.tsx b/src/app/(main)/dashboard/favorite-todo/page.tsx index b15ed558..8b4dfd1c 100644 --- a/src/app/(main)/dashboard/favorite-todo/page.tsx +++ b/src/app/(main)/dashboard/favorite-todo/page.tsx @@ -2,7 +2,7 @@ import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query import FavoriteTodoContent from '@/features/dashboard/favorite-todo/components/FavoriteTodoContent'; -import { todoQueries } from '@/shared/lib/query/queryKeys'; +import { todoQueries } from '@/shared/lib/query/queryFunction'; export const dynamic = 'force-dynamic'; diff --git a/src/app/(main)/dashboard/page.tsx b/src/app/(main)/dashboard/page.tsx index 382cb517..9eaa5c2e 100644 --- a/src/app/(main)/dashboard/page.tsx +++ b/src/app/(main)/dashboard/page.tsx @@ -5,13 +5,13 @@ import DashboardDetail from '@/features/dashboard/components/DashboardDetail'; import DashboardDetailSkeleton from '@/features/dashboard/components/DashboardDetailSkeleton'; import { DataBoundary } from '@/shared/components/ErrorSuspenseBoundary'; -import { dashboardQueries } from '@/shared/lib/query/queryKeys'; +import { dashboardQueries } from '@/shared/lib/query/queryFunction'; export const dynamic = 'force-dynamic'; /** * @description 해당 페이지는 서버 컴포넌트입니다. 클라이언트 컴포넌트로 변경하지 말아주세요 - * 'use client'로 변경 x + * 'use client'로 변경x */ export default async function DashboardPage() { diff --git a/src/app/(main)/goal/[goalId]/note/@modal/(.)[noteId]/page.tsx b/src/app/(main)/goal/[goalId]/note/@modal/(.)[noteId]/page.tsx index a97d7a6b..e17dba9e 100644 --- a/src/app/(main)/goal/[goalId]/note/@modal/(.)[noteId]/page.tsx +++ b/src/app/(main)/goal/[goalId]/note/@modal/(.)[noteId]/page.tsx @@ -1,5 +1,5 @@ import { dehydrate, QueryClient, HydrationBoundary } from '@tanstack/react-query'; -import { noteQueries, goalQueries } from '@/shared/lib/query/queryKeys'; +import { noteQueries, goalQueries } from '@/shared/lib/query/queryFunction'; import NoteDetailClient from '@/features/note/components/NoteDetailClient'; import { notFound } from 'next/navigation'; import NoteDetailModal from '@/features/note/components/NoteDetailModal'; diff --git a/src/app/(main)/goal/[goalId]/note/[noteId]/(detail)/page.tsx b/src/app/(main)/goal/[goalId]/note/[noteId]/(detail)/page.tsx index 5fd20993..f0caf63d 100644 --- a/src/app/(main)/goal/[goalId]/note/[noteId]/(detail)/page.tsx +++ b/src/app/(main)/goal/[goalId]/note/[noteId]/(detail)/page.tsx @@ -1,5 +1,5 @@ import { dehydrate, QueryClient, HydrationBoundary } from '@tanstack/react-query'; -import { noteQueries, goalQueries } from '@/shared/lib/query/queryKeys'; +import { noteQueries, goalQueries } from '@/shared/lib/query/queryFunction'; import NoteDetailClient from '@/features/note/components/NoteDetailClient'; import { notFound } from 'next/navigation'; diff --git a/src/app/(main)/goal/[goalId]/note/[noteId]/edit/page.tsx b/src/app/(main)/goal/[goalId]/note/[noteId]/edit/page.tsx index df300c6c..3144f1de 100644 --- a/src/app/(main)/goal/[goalId]/note/[noteId]/edit/page.tsx +++ b/src/app/(main)/goal/[goalId]/note/[noteId]/edit/page.tsx @@ -1,5 +1,5 @@ import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query'; -import { noteQueries, goalQueries, todoQueries } from '@/shared/lib/query/queryKeys'; +import { noteQueries, goalQueries, todoQueries } from '@/shared/lib/query/queryFunction'; import NoteEditClient from '@/features/note/components/NoteEditClient'; import { notFound } from 'next/navigation'; diff --git a/src/app/(main)/goal/[goalId]/note/page.tsx b/src/app/(main)/goal/[goalId]/note/page.tsx index 272effbd..551c092c 100644 --- a/src/app/(main)/goal/[goalId]/note/page.tsx +++ b/src/app/(main)/goal/[goalId]/note/page.tsx @@ -1,5 +1,5 @@ import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query'; -import { noteQueries, goalQueries } from '@/shared/lib/query/queryKeys'; +import { noteQueries, goalQueries } from '@/shared/lib/query/queryFunction'; import NoteListContainer from '@/features/note/components/NoteListContainer'; import { DataBoundary } from '@/shared/components/ErrorSuspenseBoundary'; diff --git a/src/app/(main)/goal/[goalId]/page.tsx b/src/app/(main)/goal/[goalId]/page.tsx index 87718f01..2618b95a 100644 --- a/src/app/(main)/goal/[goalId]/page.tsx +++ b/src/app/(main)/goal/[goalId]/page.tsx @@ -3,7 +3,7 @@ import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query import GoalSummary from '@/features/goal/components/GoalSummary'; import GoalDetail from '@/features/goal/components/GoalDetail'; -import { userQueries, goalQueries } from '@/shared/lib/query/queryKeys'; +import { userQueries, goalQueries } from '@/shared/lib/query/queryFunction'; /** * @description 해당 페이지는 서버 컴포넌트입니다. 클라이언트 컴포넌트로 변경하지 말아주세요 diff --git a/src/app/(main)/mypage/MyPageForm.tsx b/src/app/(main)/mypage/MyPageForm.tsx index 8f2289fe..3e1587c6 100644 --- a/src/app/(main)/mypage/MyPageForm.tsx +++ b/src/app/(main)/mypage/MyPageForm.tsx @@ -9,7 +9,7 @@ import Button from '@/shared/components/Button'; import FormField from '@/shared/components/FormField'; import LoadingSpinner from '@/shared/components/LoadingSpinner'; -import { userQueries } from '@/shared/lib/query/queryKeys'; +import { userQueries } from '@/shared/lib/query/queryFunction'; import { useDeleteGithubConnection, usePatchCurrentUser, @@ -186,7 +186,7 @@ export default function MyPageForm() {
{t.mypage.nicknameSuccess}
} + {nicknameSuccess && ( +{t.mypage.nicknameSuccess}
+ )} {/* 비밀번호 변경 - 소셜 로그인이면 숨김 */} @@ -279,7 +281,7 @@ export default function MyPageForm() { @@ -316,7 +318,7 @@ export default function MyPageForm() { diff --git a/src/app/api/dashboard/detail/route.ts b/src/app/api/dashboard/detail/route.ts new file mode 100644 index 00000000..9534e376 --- /dev/null +++ b/src/app/api/dashboard/detail/route.ts @@ -0,0 +1,18 @@ +import { NextResponse } from 'next/server'; + +import { getDashboardDetailTodos } from '@/shared/lib/customApi/getDashboardDetailTodos'; + +export async function GET() { + try { + const result = await getDashboardDetailTodos(); + + return NextResponse.json(result, { + status: result.hasAnySuccess ? 200 : 502, + headers: { + 'Cache-Control': 'no-store', + }, + }); + } catch { + return NextResponse.json({ message: 'Failed to fetch dashboard detail todos' }, { status: 502 }); + } +} diff --git a/src/app/api/dashboard/summary/route.ts b/src/app/api/dashboard/summary/route.ts index 3b09a7d6..64a5cc88 100644 --- a/src/app/api/dashboard/summary/route.ts +++ b/src/app/api/dashboard/summary/route.ts @@ -1,10 +1,10 @@ import { NextResponse } from 'next/server'; -import { fetchDashboard } from '@/shared/lib/api/fetchDashboard'; +import { getDashboardSummaryResult } from '@/shared/lib/customApi/getDashboardSummaryResult'; export async function GET() { try { - const result = await fetchDashboard.getDashboardSummaryResult(); + const result = await getDashboardSummaryResult(); return NextResponse.json(result, { status: result.hasAnySuccess ? 200 : 502, diff --git a/src/features/calendar/hooks/useCalendar.ts b/src/features/calendar/hooks/useCalendar.ts index 8c25b1d6..edd00dc7 100644 --- a/src/features/calendar/hooks/useCalendar.ts +++ b/src/features/calendar/hooks/useCalendar.ts @@ -2,7 +2,7 @@ import { useState } from 'react'; import { useQuery } from '@tanstack/react-query'; -import { todoQueries, goalQueries, userQueries } from '@/shared/lib/query/queryKeys'; +import { todoQueries, goalQueries, userQueries } from '@/shared/lib/query/queryFunction'; export function useCalendar() { const today = new Date(); diff --git a/src/features/dashboard/allTodo/components/AllTodoContent/index.tsx b/src/features/dashboard/allTodo/components/AllTodoContent/index.tsx index d472c167..e0a09502 100644 --- a/src/features/dashboard/allTodo/components/AllTodoContent/index.tsx +++ b/src/features/dashboard/allTodo/components/AllTodoContent/index.tsx @@ -9,7 +9,7 @@ import { DataBoundary } from '@/shared/components/ErrorSuspenseBoundary'; import PageHeader from '@/shared/components/PageHeader'; import TaskCardWrapper from '@/features/dashboard/components/TaskCardWrapper'; -import { goalQueries, todoQueries } from '@/shared/lib/query/queryKeys'; +import { goalQueries, todoQueries } from '@/shared/lib/query/queryFunction'; import { useTodoCreateModal } from '@/features/todo/hooks/useTodoCreateModal'; import type { TodoListResponse } from '@/shared/lib/api'; import { TodoOptions } from '@/shared/types/types'; @@ -40,7 +40,7 @@ export default function AllTodoContent() {