[QUDO-98] feat:emergency issue
This commit is contained in:
parent
78b633d337
commit
82cccdf94f
|
|
@ -43,7 +43,7 @@ const columns: ColumnDef<any>[] = [
|
|||
accessorKey: "type",
|
||||
header: "Channel",
|
||||
cell: ({ row }) => {
|
||||
const type = row.original.type; // Akses properti category
|
||||
const type = row.original.type;
|
||||
return <span className="normal-case">{type?.name || "N/A"}</span>;
|
||||
},
|
||||
},
|
||||
|
|
@ -67,11 +67,11 @@ const columns: ColumnDef<any>[] = [
|
|||
accessorKey: "isActive",
|
||||
header: "Status",
|
||||
cell: ({ row }) => {
|
||||
const isActive = row.getValue("isActive") as boolean; // Ambil nilai isActive
|
||||
const status = isActive ? "Open" : "Closed"; // Tentukan teks berdasarkan isActive
|
||||
const isActive = row.getValue("isActive") as boolean;
|
||||
const status = isActive ? "Open" : "Closed";
|
||||
const statusStyles = isActive
|
||||
? "bg-green-100 text-green-600" // Gaya untuk "Open"
|
||||
: "bg-red-100 text-red-600"; // Gaya untuk "Closed"
|
||||
? "bg-green-100 text-green-600"
|
||||
: "bg-red-100 text-red-600";
|
||||
|
||||
return (
|
||||
<Badge className={`rounded-full px-5 ${statusStyles}`}>{status}</Badge>
|
||||
|
|
|
|||
|
|
@ -193,8 +193,8 @@ export default function FormQuestionsReply() {
|
|||
|
||||
console.log("Berhasil kirim balasan:", res?.data);
|
||||
setReplyText("");
|
||||
setReplyValue(0); // tutup form setelah kirim
|
||||
getTicketReply(); // refresh balasan
|
||||
setReplyValue(0);
|
||||
getTicketReply();
|
||||
} catch (err) {
|
||||
console.error("Gagal kirim balasan:", err);
|
||||
}
|
||||
|
|
@ -242,7 +242,6 @@ export default function FormQuestionsReply() {
|
|||
try {
|
||||
const response = await saveTicketReply(data);
|
||||
|
||||
// Tambahkan balasan baru ke daftar balasan
|
||||
const newReply: replyDetail = {
|
||||
id: response?.data?.id,
|
||||
comments: replyMessage,
|
||||
|
|
@ -259,7 +258,6 @@ export default function FormQuestionsReply() {
|
|||
icon: "success",
|
||||
});
|
||||
|
||||
// Reset input dan sembunyikan form balasan
|
||||
setReplyMessage("");
|
||||
setReplyVisible(false);
|
||||
} catch (error) {
|
||||
|
|
@ -293,7 +291,6 @@ export default function FormQuestionsReply() {
|
|||
icon: "success",
|
||||
});
|
||||
|
||||
// Refresh data jika perlu
|
||||
getTicketReply();
|
||||
} catch (error) {
|
||||
console.error("Gagal update:", error);
|
||||
|
|
|
|||
|
|
@ -164,15 +164,14 @@ export default function FormDetailTicketing() {
|
|||
const optionArr = rawUser?.map((option: any) => ({
|
||||
id: option.id,
|
||||
label: option.fullName,
|
||||
value: option.id.toString(), // pastikan string
|
||||
value: option.id.toString(),
|
||||
}));
|
||||
setOperatorOpt(optionArr);
|
||||
|
||||
// 👇 Parse `assignedTeams` ke dalam array string
|
||||
if (detailTickets?.assignedTeams) {
|
||||
const assigned = detailTickets.assignedTeams
|
||||
.split(":")
|
||||
.filter((id: string) => id); // hapus string kosong
|
||||
.filter((id: string) => id);
|
||||
setSelectedOperator(assigned);
|
||||
}
|
||||
}
|
||||
|
|
@ -201,8 +200,8 @@ export default function FormDetailTicketing() {
|
|||
|
||||
console.log("Berhasil kirim balasan:", res?.data);
|
||||
setReplyText("");
|
||||
setReplyValue(0); // tutup form setelah kirim
|
||||
getTicketReply(); // refresh balasan
|
||||
setReplyValue(0);
|
||||
getTicketReply();
|
||||
} catch (err) {
|
||||
console.error("Gagal kirim balasan:", err);
|
||||
}
|
||||
|
|
@ -233,7 +232,6 @@ export default function FormDetailTicketing() {
|
|||
try {
|
||||
const response = await saveTicketReply(data);
|
||||
|
||||
// Tambahkan balasan baru ke daftar balasan
|
||||
const newReply: replyDetail = {
|
||||
id: response?.data?.id,
|
||||
comments: replyMessage,
|
||||
|
|
@ -250,7 +248,6 @@ export default function FormDetailTicketing() {
|
|||
icon: "success",
|
||||
});
|
||||
|
||||
// Reset input dan sembunyikan form balasan
|
||||
setReplyMessage("");
|
||||
setReplyVisible(false);
|
||||
} catch (error) {
|
||||
|
|
|
|||
|
|
@ -174,15 +174,14 @@ export default function FormUpdateTicketing() {
|
|||
const optionArr = rawUser?.map((option: any) => ({
|
||||
id: option.id,
|
||||
label: option.fullName,
|
||||
value: option.id.toString(), // pastikan string
|
||||
value: option.id.toString(),
|
||||
}));
|
||||
setOperatorOpt(optionArr);
|
||||
|
||||
// 👇 Parse `assignedTeams` ke dalam array string
|
||||
if (detailTickets?.assignedTeams) {
|
||||
const assigned = detailTickets.assignedTeams
|
||||
.split(":")
|
||||
.filter((id: string) => id); // hapus string kosong
|
||||
.filter((id: string) => id);
|
||||
setSelectedOperator(assigned);
|
||||
}
|
||||
}
|
||||
|
|
@ -199,7 +198,7 @@ export default function FormUpdateTicketing() {
|
|||
}
|
||||
|
||||
const handleReply = () => {
|
||||
setReplyVisible((prev) => !prev); // Toggle visibility
|
||||
setReplyVisible((prev) => !prev);
|
||||
};
|
||||
|
||||
const handleSendReply = async () => {
|
||||
|
|
@ -220,7 +219,6 @@ export default function FormUpdateTicketing() {
|
|||
try {
|
||||
const response = await saveTicketReply(data);
|
||||
|
||||
// Tambahkan balasan baru ke daftar balasan
|
||||
const newReply: replyDetail = {
|
||||
id: response?.data?.id,
|
||||
comments: replyMessage,
|
||||
|
|
@ -237,7 +235,6 @@ export default function FormUpdateTicketing() {
|
|||
icon: "success",
|
||||
});
|
||||
|
||||
// Reset input dan sembunyikan form balasan
|
||||
setReplyMessage("");
|
||||
setReplyVisible(false);
|
||||
} catch (error) {
|
||||
|
|
@ -293,7 +290,7 @@ export default function FormUpdateTicketing() {
|
|||
description: data.description,
|
||||
priority: data.priority,
|
||||
status: data.status,
|
||||
operatorTeam: selectedOperator.join(","), // Gunakan selectedOperator yang sudah ada
|
||||
operatorTeam: selectedOperator.join(","),
|
||||
};
|
||||
|
||||
if (id) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue