Skip to content

Commit

Permalink
async the params
Browse files Browse the repository at this point in the history
  • Loading branch information
Marfuen committed Feb 6, 2025
1 parent 0329805 commit 161bb1f
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@ import { auth } from "@/auth";
import { redirect } from "next/navigation";
import { EmployeeDetails } from "./components/employee-details";

interface PageProps {
params: {
employeeId: string;
locale: string;
};
}

export default async function EmployeeDetailsPage({ params }: PageProps) {
export default async function EmployeeDetailsPage({
params,
}: {
params: Promise<{ employeeId: string }>;
}) {
const session = await auth();
const organizationId = session?.user.organizationId;

if (!organizationId) {
redirect("/");
}

return <EmployeeDetails employeeId={params.employeeId} />;
const { employeeId } = await params;

return <EmployeeDetails employeeId={employeeId} />;
}

0 comments on commit 161bb1f

Please sign in to comment.