diff --git a/src/app/[lang]/dashboard/agents/[id]/page.tsx b/src/app/[lang]/dashboard/agents/[id]/page.tsx index ee1a7cf0..0cda7012 100644 --- a/src/app/[lang]/dashboard/agents/[id]/page.tsx +++ b/src/app/[lang]/dashboard/agents/[id]/page.tsx @@ -1,19 +1,8 @@ import ProfileLayout from "@/components/Dashboard/Profile/ProfileLayout"; -import { getServerUserRole } from "@/hooks/api/getUserRole"; import { RouteParams } from "@/types"; -import { UserRole } from "need4deed-sdk"; -import { cookies } from "next/headers"; -import { redirect } from "next/navigation"; export default async function DashboardAgentPage({ params }: RouteParams) { const { id } = await params; - const cookieStore = await cookies(); - const cookieHeader = cookieStore.toString(); - const userRole = await getServerUserRole(cookieHeader); - - if (!userRole || (userRole !== UserRole.COORDINATOR && userRole !== UserRole.ADMIN)) { - redirect(`/dashboard/agents`); - } return ; } diff --git a/src/components/Dashboard/Agents/AgentReadOnlyTableRow.tsx b/src/components/Dashboard/Agents/AgentReadOnlyTableRow.tsx index 9f3b7113..faedaeae 100644 --- a/src/components/Dashboard/Agents/AgentReadOnlyTableRow.tsx +++ b/src/components/Dashboard/Agents/AgentReadOnlyTableRow.tsx @@ -12,6 +12,7 @@ interface Props { export function AgentReadOnlyTableRow({ agent, isLast, districtsList }: Props) { const { id, title, type, district } = agent; const districtTitle = district?.id ? (districtsList?.find((d) => d.id === district.id)?.title ?? null) : null; + return ( {title}