diff --git a/app/[locale]/(protected)/contributor/agenda-setting/event-modal.tsx b/app/[locale]/(protected)/contributor/agenda-setting/event-modal.tsx index a0b9d18a..05846ec0 100644 --- a/app/[locale]/(protected)/contributor/agenda-setting/event-modal.tsx +++ b/app/[locale]/(protected)/contributor/agenda-setting/event-modal.tsx @@ -59,7 +59,9 @@ import WaveSurfer from "wavesurfer.js"; const schema = z.object({ title: z.string().min(3, { message: "Required" }), - description: z.string().min(3, { message: "Required" }), + description: z + .string() + .min(2, { message: "Narasi Penugasan harus lebih dari 2 karakter." }), }); interface FileWithPreview extends File { @@ -164,8 +166,8 @@ const EventModal = ({ const detail = res?.data?.data; setDetailData(detail); - const description = detail?.description; - console.log("description", res?.data?.description); + const description = res?.data?.data?.description; + console.log("description", res?.data?.data?.description); // Set nilai awal description ke form control if (description) { @@ -185,6 +187,16 @@ const EventModal = ({ setAudioUploadedFiles( attachments?.filter((file: any) => file.fileTypeId == 4) ); + + const agendaType = detail?.agendaType; + setWilayahPublish({ + semua: agendaType === "all", + nasional: agendaType === "mabes", + polda: agendaType === "polda", + polres: agendaType === "polres", + satker: agendaType === "satker", + international: agendaType === "international", + }); } fetchDetailData(); @@ -621,6 +633,7 @@ const EventModal = ({ {event?.title} +
@@ -819,7 +832,7 @@ const EventModal = ({ name="description" render={({ field }) => (