- {/* Tag yang ditampilkan secara kolom */}
{selectedOperator.length > 0 && (
-
+
{selectedOperator.map((id) => {
const label = operatorOpt.find(
(op: any) => op.value === id
@@ -433,7 +431,7 @@ export default function FormQuestionsForward() {
components={animatedComponent}
onChange={handleChange}
formatOptionLabel={formatOptionLabel}
- isMulti={false}
+ isMulti={true}
/>
diff --git a/components/form/communication/internal-detail-form.tsx b/components/form/communication/internal-detail-form.tsx
index a418007b..034ad329 100644
--- a/components/form/communication/internal-detail-form.tsx
+++ b/components/form/communication/internal-detail-form.tsx
@@ -130,7 +130,7 @@ export default function FormDetailInternal() {
}
const handleReply = () => {
- setReplyVisible((prev) => !prev); // Toggle visibility
+ setReplyVisible((prev) => !prev);
};
const handleSendReply = async () => {
@@ -149,18 +149,9 @@ export default function FormDetailInternal() {
};
try {
- const response = await saveTicketInternalReply(data);
+ await saveTicketInternalReply(data);
- // Tambahkan balasan baru ke daftar balasan
- const newReply: replyDetail = {
- id: response?.data?.id,
- message: replyMessage,
- createdAt: response?.data?.createdAt,
- messageFrom: response?.data?.messageFrom,
- messageTo: response?.data?.messageTo,
- };
-
- setTicketReply((prevReplies) => [newReply, ...prevReplies]);
+ await getTicketReply();
MySwal.fire({
title: "Sukses",
@@ -168,7 +159,6 @@ export default function FormDetailInternal() {
icon: "success",
});
- // Reset input dan sembunyikan form balasan
setReplyMessage("");
setReplyVisible(false);
} catch (error) {
diff --git a/components/form/communication/internal-form.tsx b/components/form/communication/internal-form.tsx
index 1189600f..3c6ee52b 100644
--- a/components/form/communication/internal-form.tsx
+++ b/components/form/communication/internal-form.tsx
@@ -30,7 +30,7 @@ import dynamic from "next/dynamic";
const taskSchema = z.object({
title: z.string().min(1, { message: "Judul diperlukan" }),
- naration: z.string().min(2, {
+ message: z.string().min(2, {
message: "Narasi Penugasan harus lebih dari 2 karakter.",
}),
});
@@ -77,13 +77,12 @@ export default function FormInternal() {
);
const animatedComponent = makeAnimated();
const [platformTypeVisible, setPlatformTypeVisible] = useState(false);
- const [selectedTarget, setSelectedTarget] = useState("");
+ const [selectedTarget, setSelectedTarget] = useState
(null);
- // Opsi untuk dropdown
const priority = [
- { value: "low", label: "Low" },
- { value: "medium", label: "Medium" },
- { value: "high", label: "High" },
+ { value: 1, label: "Low" },
+ { value: 2, label: "Medium" },
+ { value: 3, label: "High" },
];
const {
@@ -142,7 +141,6 @@ export default function FormInternal() {
const rawUser = res?.data?.data?.content;
console.log("raw user", rawUser);
- // Tentukan tipe array sebagai Option[]
const optionArr: Option[] = rawUser.map((option: any) => ({
id: option?.id,
label: option?.username + option?.fullname + option?.userLevel?.name,
@@ -159,9 +157,9 @@ export default function FormInternal() {
const save = async (data: TaskSchema) => {
const requestData = {
title: data.title,
- narration: data.naration,
+ message: data.message,
target: selectedTarget,
- sendToId: selectedOption?.id, // This should work now without the error
+ sendToId: selectedOption?.id,
};
const response = await saveTicketingInternal(requestData);
@@ -176,7 +174,7 @@ export default function FormInternal() {
confirmButtonColor: "#3085d6",
confirmButtonText: "OK",
}).then(() => {
- router.push("/en/shared/communication");
+ router.push("/in/shared/communication");
});
};
@@ -198,13 +196,15 @@ export default function FormInternal() {
return (
-