@@ -16,17 +16,16 @@ import {
|
||||
} from "@/lib/portfolio";
|
||||
|
||||
type PortfolioCategoryPageProps = {
|
||||
params: {
|
||||
params: Promise<{
|
||||
locale: string;
|
||||
slug: string;
|
||||
};
|
||||
}>;
|
||||
};
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export async function generateMetadata({
|
||||
params: { locale, slug },
|
||||
}: PortfolioCategoryPageProps): Promise<Metadata> {
|
||||
export async function generateMetadata({ params }: PortfolioCategoryPageProps): Promise<Metadata> {
|
||||
const { locale, slug } = await params;
|
||||
const localeKey = resolveLocale(locale);
|
||||
const t = await getTranslations({ locale: localeKey, namespace: "portfolioPage" });
|
||||
const category = await getActivePortfolioCategoryBySlug(slug);
|
||||
@@ -49,8 +48,9 @@ export async function generateMetadata({
|
||||
}
|
||||
|
||||
export default async function PortfolioCategoryPage({
|
||||
params: { locale, slug },
|
||||
params,
|
||||
}: PortfolioCategoryPageProps) {
|
||||
const { locale, slug } = await params;
|
||||
const localeKey = resolveLocale(locale);
|
||||
const t = await getTranslations({ locale: localeKey, namespace: "portfolioPage" });
|
||||
const [categories, category, projects] = await Promise.all([
|
||||
|
||||
@@ -3,14 +3,15 @@ import { permanentRedirect } from "next/navigation";
|
||||
import { getLocalizedPath, resolveLocale } from "@/lib/locale";
|
||||
|
||||
type PortfolioCategoryIndexPageProps = {
|
||||
params: {
|
||||
params: Promise<{
|
||||
locale: string;
|
||||
};
|
||||
}>;
|
||||
};
|
||||
|
||||
export default function PortfolioCategoryIndexPage({
|
||||
params: { locale },
|
||||
export default async function PortfolioCategoryIndexPage({
|
||||
params,
|
||||
}: PortfolioCategoryIndexPageProps) {
|
||||
const { locale } = await params;
|
||||
const localeKey = resolveLocale(locale);
|
||||
|
||||
permanentRedirect(getLocalizedPath(localeKey, "/portfolio"));
|
||||
|
||||
Reference in New Issue
Block a user