feat: Enhance delete confirmation with brand name in notification message

This commit is contained in:
2025-11-18 12:43:00 +07:00
parent 8405568e85
commit 3198b71f7e

View File

@@ -157,12 +157,12 @@ const ListBrandDevice = memo(function ListBrandDevice(props) {
icon: 'question', icon: 'question',
title: 'Konfirmasi', title: 'Konfirmasi',
message: 'Apakah anda yakin hapus data "' + param.brand_name + '" ?', message: 'Apakah anda yakin hapus data "' + param.brand_name + '" ?',
onConfirm: () => handleDelete(param.brand_id), onConfirm: () => handleDelete(param.brand_id, param.brand_name),
onCancel: () => {}, onCancel: () => {},
}); });
}; };
const handleDelete = async (brand_id) => { const handleDelete = async (brand_id, brand_name) => {
try { try {
const response = await deleteBrand(brand_id); const response = await deleteBrand(brand_id);
@@ -170,7 +170,7 @@ const ListBrandDevice = memo(function ListBrandDevice(props) {
NotifOk({ NotifOk({
icon: 'success', icon: 'success',
title: 'Berhasil', title: 'Berhasil',
message: response.message || 'Data Brand Device berhasil dihapus.', message: `Brand ${brand_name} deleted successfully.`,
}); });
doFilter(); // Refresh data doFilter(); // Refresh data
} else { } else {
@@ -278,4 +278,4 @@ const ListBrandDevice = memo(function ListBrandDevice(props) {
); );
}); });
export default ListBrandDevice; export default ListBrandDevice;