diff --git a/src/actions/todo.ts b/src/actions/todo.ts index 9c74a85..2897287 100644 --- a/src/actions/todo.ts +++ b/src/actions/todo.ts @@ -2,7 +2,7 @@ import { addGoalTodoService, handleDeleteGoalByIdService, -} from "@/app/services/todo"; +} from "@/services/todo"; import { InvalidAddTodoGoalException } from "@/exceptions/error"; import { log } from "@/lib/log"; import { validateAddTodoGoal } from "@/schema/todo"; diff --git a/src/app/(protected)/app/goals/(ui)/goals-component.tsx b/src/app/(protected)/app/goals/(ui)/goals-component.tsx index 0e0f31f..5116c85 100644 --- a/src/app/(protected)/app/goals/(ui)/goals-component.tsx +++ b/src/app/(protected)/app/goals/(ui)/goals-component.tsx @@ -11,9 +11,7 @@ import { Input, } from "@nextui-org/react"; import { Todo } from "@prisma/client"; -import { FunctionComponent, useState, useTransition } from "react"; - -import { TiDeleteOutline } from "react-icons/ti"; +import { FunctionComponent, useTransition } from "react"; import { RiMoreFill } from "react-icons/ri"; interface GoalsProps { @@ -22,7 +20,6 @@ interface GoalsProps { const Goals: FunctionComponent = ({ goals }) => { const [, startTransition] = useTransition(); - const [starColor, setStarColor] = useState(false); const handleDeleteGoalFn = async (id: string) => { startTransition(async () => { await handleDeleteGoalAction(id); @@ -80,10 +77,8 @@ const Goals: FunctionComponent = ({ goals }) => { {/* actions section */}
-
created At -
@@ -108,8 +103,8 @@ const Goals: FunctionComponent = ({ goals }) => { Create a copy handleDeleteGoalFn(goal.id)} diff --git a/src/app/(protected)/app/goals/page.tsx b/src/app/(protected)/app/goals/page.tsx index 65379a2..8777163 100644 --- a/src/app/(protected)/app/goals/page.tsx +++ b/src/app/(protected)/app/goals/page.tsx @@ -1,6 +1,6 @@ import { UserNotFoundException } from "@/exceptions/error"; import authOptions from "@/lib/authOptions"; -import { getGoalsFromTodo, getTodoList } from "@/lib/todo"; +import { getGoalsFromTodo, getTodoList } from "@/queries/todo"; import { Chip, Divider, Spinner } from "@nextui-org/react"; import { getServerSession } from "next-auth"; import { FunctionComponent, Suspense } from "react"; @@ -48,8 +48,8 @@ const Today: FunctionComponent = async () => { {Array.isArray(goals) && goals?.length > 0 ? ( - ): null} - }> + ) : null} + }>
diff --git a/src/app/(protected)/app/layout.tsx b/src/app/(protected)/app/layout.tsx index a7906ae..0346ab6 100644 --- a/src/app/(protected)/app/layout.tsx +++ b/src/app/(protected)/app/layout.tsx @@ -1,7 +1,7 @@ import { FunctionComponent } from "react"; import authOptions from "@/lib/authOptions"; -import { getUserInfo } from "@/lib/user"; +import { getUserInfo } from "@/queries/user"; import { getServerSession } from "next-auth"; import Info from "./(ui)/info-component"; diff --git a/src/middleware.ts b/src/middleware.ts index 0850ce4..d246d38 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -48,5 +48,5 @@ export default withAuth( ); export const config = { - matcher: ["/app", "/api/:path*"], + matcher: ["/app","/app/*", "/api/:path*"], }; diff --git a/src/lib/todo/index.ts b/src/queries/todo/index.ts similarity index 100% rename from src/lib/todo/index.ts rename to src/queries/todo/index.ts diff --git a/src/lib/user/index.ts b/src/queries/user/index.ts similarity index 100% rename from src/lib/user/index.ts rename to src/queries/user/index.ts diff --git a/src/app/services/todo.ts b/src/services/todo.ts similarity index 92% rename from src/app/services/todo.ts rename to src/services/todo.ts index 7b4e072..e5741ef 100644 --- a/src/app/services/todo.ts +++ b/src/services/todo.ts @@ -3,7 +3,7 @@ import { UserNotFoundException, } from "@/exceptions/error"; import authOptions from "@/lib/authOptions"; -import { addTodoGoal, deleteTodoGoal, getTodoList } from "@/lib/todo"; +import { addTodoGoal, deleteTodoGoal, getTodoList } from "@/queries/todo"; import { GoalPayload } from "@/types/todo"; import { getServerSession } from "next-auth";