diff --git a/components/form/task-ta/task-ta-detail-form.tsx b/components/form/task-ta/task-ta-detail-form.tsx index ab7424d8..83b24a56 100644 --- a/components/form/task-ta/task-ta-detail-form.tsx +++ b/components/form/task-ta/task-ta-detail-form.tsx @@ -1520,7 +1520,7 @@ export default function FormTaskTaDetail() { {urlInputs.map((url: any, index: any) => ( - // handleLinkChange(index, e.target.value) - // } placeholder={`Masukkan link berita ${index + 1}`} /> diff --git a/components/form/task-ta/task-ta-edit-form.tsx b/components/form/task-ta/task-ta-edit-form.tsx index 9e055c2a..8eeea104 100644 --- a/components/form/task-ta/task-ta-edit-form.tsx +++ b/components/form/task-ta/task-ta-edit-form.tsx @@ -588,7 +588,9 @@ export default function FormTaskTaEdit() { narration: data.naration, expertCompetencies: Array.from(selectedCompetencies).join(","), title: data.title, - attachmentUrl: links, + attachmentUrl: urlInputs + .map((url: any) => url.attachmentUrl || "") + .filter((url: string) => url.trim() !== ""), }; const response = await createTaskTa(requestData); @@ -802,7 +804,7 @@ export default function FormTaskTaEdit() { isAudioUploadFinish && isTextUploadFinish ) { - successSubmit("/in/contributor/task"); + successSubmit("/in/contributor/task-ta"); } } @@ -841,9 +843,11 @@ export default function FormTaskTaEdit() { }; const handleLinkChange = (index: number, value: string) => { - const updatedLinks = [...links]; - updatedLinks[index] = value; - setLinks(updatedLinks); + setUrlInputs((prev: any) => + prev.map((url: any, idx: any) => + idx === index ? { ...url, attachmentUrl: value } : url + ) + ); }; const handleAddLink = () => { @@ -1188,7 +1192,9 @@ export default function FormTaskTaEdit() { {isRecording &&

Recording... {timer} seconds remaining

}{" "} {/* Display remaining time */}
-

{t("news-links", { defaultValue: "News Links" })}

+

+ {t("news-links", { defaultValue: "News Links" })} +

{urlInputs.map((url: any, index: any) => (
))} -
- - {links.map((link, index) => ( -
- - handleLinkChange(index, e.target.value) - } - /> - {links.length > 1 && ( - - )} -
- ))} - -
+
diff --git a/components/form/task-ta/task-ta-form.tsx b/components/form/task-ta/task-ta-form.tsx index 2c0c217a..42a0a3a1 100644 --- a/components/form/task-ta/task-ta-form.tsx +++ b/components/form/task-ta/task-ta-form.tsx @@ -363,7 +363,8 @@ export default function FormTaskTa() { assignmentType: taskType, assignmentTypeId: type, expertCompetencies: Array.from(selectedCompetencies).join(","), - attachmentUrl: cleanedLinks, + title: data.title, + attachmentUrl: links, }; const response = await createTaskTa(requestData); diff --git a/components/form/task-ta/task-ta-upload-form.tsx b/components/form/task-ta/task-ta-upload-form.tsx index fba6b988..469eac18 100644 --- a/components/form/task-ta/task-ta-upload-form.tsx +++ b/components/form/task-ta/task-ta-upload-form.tsx @@ -331,10 +331,10 @@ export default function FormTaskTaNew() { htmlDescription: finalDescription, fileTypeId: fileTypeId, categoryId: "235", - subCategoryId: selectedCategory, + subCategoryId: "171", uploadedBy: "2b7c8d83-d298-4b19-9f74-b07924506b58", statusId: "1", - publishedFor: publishedFor.join(","), + publishedFor: "7", creatorName: "Penugasan-Ta", tags: "penugasan-Ta", isYoutube: false,