From 412ba9ca41759d8caa44f8debb1f6610c4d4836e Mon Sep 17 00:00:00 2001 From: amritkv Date: Mon, 11 Dec 2023 15:57:49 +0530 Subject: [PATCH] fix(edit_project): Added route from project detail to edit projetcs page --- .../detail/[id]/components/ProjectDetailTab.tsx | 13 +++++++++++-- src/object-types/Project.ts | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/app/[locale]/projects/detail/[id]/components/ProjectDetailTab.tsx b/src/app/[locale]/projects/detail/[id]/components/ProjectDetailTab.tsx index a5324ada7..580b7f7a9 100644 --- a/src/app/[locale]/projects/detail/[id]/components/ProjectDetailTab.tsx +++ b/src/app/[locale]/projects/detail/[id]/components/ProjectDetailTab.tsx @@ -11,7 +11,7 @@ import { signOut, useSession } from 'next-auth/react' import { useTranslations } from 'next-intl' -import { notFound } from 'next/navigation' +import { notFound, useRouter } from 'next/navigation' import { useEffect, useState } from 'react' import { Button, Col, Dropdown, ListGroup, Row, Spinner, Tab } from 'react-bootstrap' @@ -29,6 +29,7 @@ export default function ViewProjects({ projectId }: { projectId: string }) { const [summaryData, setSummaryData] = useState(undefined) const [administrationData, setAdministrationData] = useState(undefined) const [show, setShow] = useState(false) + const router = useRouter() useEffect(() => { if (status !== 'authenticated') return @@ -61,6 +62,10 @@ export default function ViewProjects({ projectId }: { projectId: string }) { return () => controller.abort() }, [projectId, session]) + const handleEditProject = (projectId: string) => { + router.push(`/projects/edit/${projectId}`) + } + return ( <> @@ -105,7 +110,11 @@ export default function ViewProjects({ projectId }: { projectId: string }) { -