8e0e4b9c59
- Add src/app/admin/offers/[id]/edit/page.tsx as async server component - Fetches getOfferEditorData(id) + getOfferFieldOptions() via Promise.all - Calls notFound() when offer id does not exist - Delegates rendering to OfferEditorClient
24 lines
582 B
TypeScript
24 lines
582 B
TypeScript
import { notFound } from "next/navigation";
|
|
import { getOfferEditorData, getOfferFieldOptions } from "@/lib/offer-queries";
|
|
import { OfferEditorClient } from "@/components/admin/offers/OfferEditorClient";
|
|
|
|
export const revalidate = 0;
|
|
|
|
export default async function OfferEditPage({
|
|
params,
|
|
}: {
|
|
params: Promise<{ id: string }>;
|
|
}) {
|
|
const { id } = await params;
|
|
const [data, options] = await Promise.all([
|
|
getOfferEditorData(id),
|
|
getOfferFieldOptions(),
|
|
]);
|
|
|
|
if (!data) {
|
|
notFound();
|
|
}
|
|
|
|
return <OfferEditorClient data={data} fieldOptions={options} />;
|
|
}
|