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 {
setIsSaving(true);
loading();
const description =
selectedFileType === "original"
? data.contentDescription
@ -622,16 +622,26 @@ export default function FormConvertSPIT() {
: getPlacementData("polda"),
};
await convertSPIT(requestData);
MySwal.fire({
title: "Success",
text: "Data saved successfully",
icon: "success",
confirmButtonColor: "#3085d6",
}).then(() => {
loadDetail();
});
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({
title: "Success",
text: "Data saved successfully",
icon: "success",
confirmButtonColor: "#3085d6",
}).then(() => {
loadDetail();
});
}
} catch (error) {
console.error("Failed to save:", error);
MySwal.fire({