diff options
author | 2025-04-28 08:32:07 +0530 | |
---|---|---|
committer | 2025-04-28 08:32:07 +0530 | |
commit | d2c03d9417fb289d455f80f4c6facd7274c31d3e (patch) | |
tree | 3de135eb932ff20aa50abfb39d5a8abba4758d65 /frontend/src/app/(main)/goals | |
parent | 538d933baef56d7ee76f78617b553d63713efa24 (diff) | |
download | finance-master.tar.gz finance-master.tar.bz2 finance-master.zip |
Diffstat (limited to 'frontend/src/app/(main)/goals')
-rw-r--r-- | frontend/src/app/(main)/goals/[id]/page.tsx | 5 | ||||
-rw-r--r-- | frontend/src/app/(main)/goals/edit/[id]/page.tsx | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/frontend/src/app/(main)/goals/[id]/page.tsx b/frontend/src/app/(main)/goals/[id]/page.tsx index 3428ca4..cda33c1 100644 --- a/frontend/src/app/(main)/goals/[id]/page.tsx +++ b/frontend/src/app/(main)/goals/[id]/page.tsx @@ -12,9 +12,12 @@ import { useToast } from "@/components/ui/use-toast"; import { formatCurrency } from "@/lib/utils"; import { api } from "@/lib/api"; import { GoalProgress } from "../components/goals-list"; +import { use } from "react"; export default function GoalDetailPage({ params }: { params: { id: string } }) { - const id = params.id; + // Unwrap params Promise using React.use() + const unwrappedParams = use(params); + const id = unwrappedParams.id; const goalId = parseInt(id); const [goal, setGoal] = useState<GoalWithProgress | null>(null); diff --git a/frontend/src/app/(main)/goals/edit/[id]/page.tsx b/frontend/src/app/(main)/goals/edit/[id]/page.tsx index ed51f92..4c02bb2 100644 --- a/frontend/src/app/(main)/goals/edit/[id]/page.tsx +++ b/frontend/src/app/(main)/goals/edit/[id]/page.tsx @@ -1,5 +1,6 @@ import { Metadata } from "next"; import { GoalForm } from "../../components/goal-form"; +import { use } from "react"; export const metadata: Metadata = { title: "Edit Goal | Finance", @@ -7,10 +8,11 @@ export const metadata: Metadata = { }; export default function EditGoalPage({ params }: { params: { id: string } }) { + const unwrappedParams = use(params); return ( <div className="container mx-auto py-8"> <h1 className="text-2xl font-bold tracking-tight mb-6">Edit Goal</h1> - <GoalForm goalId={parseInt(params.id)} /> + <GoalForm goalId={parseInt(unwrappedParams.id)} /> </div> ); }
\ No newline at end of file |