feat:fix detail agenda setting
This commit is contained in:
parent
e643eda2c6
commit
a44b275f73
|
|
@ -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}
|
||||
</DialogTitle>
|
||||
</DialogHeader>
|
||||
|
||||
<div className="mt-6 h-full ">
|
||||
<form className="h-full" onSubmit={handleSubmit(onSubmit)}>
|
||||
<div className="space-y-4 pb-5 ">
|
||||
|
|
@ -819,7 +832,7 @@ const EventModal = ({
|
|||
name="description"
|
||||
render={({ field }) => (
|
||||
<Textarea
|
||||
defaultValue={field.value}
|
||||
value={field.value}
|
||||
onChange={field.onChange}
|
||||
placeholder="Enter Title"
|
||||
/>
|
||||
|
|
@ -833,6 +846,7 @@ const EventModal = ({
|
|||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="space-y-1.5">
|
||||
<Label htmlFor="attachments">Lampiran</Label>
|
||||
<div className="space-y-3">
|
||||
|
|
|
|||
Loading…
Reference in New Issue