diff --git a/src/actions/Tim.ts b/src/actions/Tim.ts index a6c4800..df1acb4 100644 --- a/src/actions/Tim.ts +++ b/src/actions/Tim.ts @@ -2,15 +2,18 @@ import { revalidatePath } from "next/cache"; import { deleteTim, updateTim } from "@/queries/tim.query"; +import { Tipe } from "@prisma/client"; export async function updateTimForm(data: FormData, id: string) { const asal_sekolah = data.get("asal_sekolah") as string; + const tipe_tim = data.get("tipe_tim") as Tipe; try { await updateTim( { id }, { asal_sekolah: asal_sekolah, + tipe_tim: tipe_tim } ); revalidatePath("/", "layout"); diff --git a/src/app/(admin)/admin/tim/[id]/components/Form.tsx b/src/app/(admin)/admin/tim/[id]/components/Form.tsx index 98aaa06..92f46b3 100644 --- a/src/app/(admin)/admin/tim/[id]/components/Form.tsx +++ b/src/app/(admin)/admin/tim/[id]/components/Form.tsx @@ -27,6 +27,11 @@ export default function TimForm({ { label: "SMA", value: "SMA" }, ]; + const options_type = [ + { label: "12 Anggota", value: "SMALL" }, + { label: "15 Anggota", value: "NORMAL" }, + ]; + async function Update(data: FormData) { const toastId = toast.loading("Loading..."); const result = await updateTimForm(data, id!); @@ -111,6 +116,37 @@ export default function TimForm({ /> +