fix: update message spit

This commit is contained in:
hanif salafi 2025-12-03 07:12:33 +07:00
parent 1230c219f7
commit 33f88feb60
1 changed files with 21 additions and 11 deletions

View File

@ -602,7 +602,7 @@ export default function FormConvertSPIT() {
try { try {
setIsSaving(true); setIsSaving(true);
loading();
const description = const description =
selectedFileType === "original" selectedFileType === "original"
? data.contentDescription ? data.contentDescription
@ -622,8 +622,17 @@ export default function FormConvertSPIT() {
: getPlacementData("polda"), : getPlacementData("polda"),
}; };
await convertSPIT(requestData); const res = await convertSPIT(requestData);
close();
if (res?.error) {
console.error(res.message);
MySwal.fire({
title: "Error",
text: res?.message,
icon: "error",
confirmButtonColor: "#3085d6",
});
} else {
MySwal.fire({ MySwal.fire({
title: "Success", title: "Success",
text: "Data saved successfully", text: "Data saved successfully",
@ -632,6 +641,7 @@ export default function FormConvertSPIT() {
}).then(() => { }).then(() => {
loadDetail(); loadDetail();
}); });
}
} catch (error) { } catch (error) {
console.error("Failed to save:", error); console.error("Failed to save:", error);
MySwal.fire({ MySwal.fire({