first commit
This commit is contained in:
18
app/(admin)/admin/countries/[id]/edit/page.tsx
Normal file
18
app/(admin)/admin/countries/[id]/edit/page.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import { db } from "@/lib/db";
|
||||
import { notFound } from "next/navigation";
|
||||
import CountryForm from "../../CountryForm";
|
||||
|
||||
export default async function EditCountryPage({ params }: { params: { id: string } }) {
|
||||
const [country, groups] = await Promise.all([
|
||||
db.country.findUnique({ where: { id: params.id } }),
|
||||
db.group.findMany({ orderBy: { name: "asc" } }),
|
||||
]);
|
||||
if (!country) notFound();
|
||||
|
||||
return (
|
||||
<div className="max-w-md">
|
||||
<h1 className="text-2xl font-bold mb-6">ویرایش تیم ملی</h1>
|
||||
<CountryForm groups={groups} countryId={country.id} initial={country} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user