fix: fixing payload in escalation
This commit is contained in:
commit
a906f4faee
|
|
@ -139,17 +139,27 @@ export default function FormQuestionsForward() {
|
|||
formState: { errors },
|
||||
} = useForm({
|
||||
resolver: zodResolver(taskSchema),
|
||||
defaultValues: {
|
||||
title: "",
|
||||
description: "",
|
||||
},
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
async function initState() {
|
||||
const response = await getQuestionTicket(id);
|
||||
setDetail(response?.data?.data);
|
||||
const data = response?.data?.data;
|
||||
setDetail(data);
|
||||
|
||||
if (response?.data !== null) {
|
||||
setDetailTickets(response?.data?.data);
|
||||
if (data) {
|
||||
reset({
|
||||
title: data.message ?? "",
|
||||
description: data.emergencyIssue?.description ?? "",
|
||||
});
|
||||
}
|
||||
|
||||
setDetailTickets(data);
|
||||
|
||||
if (detailTickets?.emergencyIssue) {
|
||||
reset({
|
||||
title: detailTickets.emergencyIssue.title || "",
|
||||
|
|
@ -334,7 +344,7 @@ export default function FormQuestionsForward() {
|
|||
<p className="mx-3 mt-3">Properties</p>
|
||||
<div className="space-y-2 px-3">
|
||||
<Label>Judul</Label>
|
||||
<Controller
|
||||
{/* <Controller
|
||||
control={control}
|
||||
name="title"
|
||||
render={({ field }) => (
|
||||
|
|
@ -346,6 +356,18 @@ export default function FormQuestionsForward() {
|
|||
placeholder="Masukkan judul"
|
||||
/>
|
||||
)}
|
||||
/> */}
|
||||
<Controller
|
||||
control={control}
|
||||
name="title"
|
||||
render={({ field }) => (
|
||||
<Input
|
||||
size="md"
|
||||
type="text"
|
||||
{...field}
|
||||
placeholder="Masukkan judul"
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue