51 lines
2.6 KiB
TypeScript
51 lines
2.6 KiB
TypeScript
import Swal from "sweetalert2";
|
|
import trans from "../../modules/trans";
|
|
const customerDelete = document.getElementById("customerDelete");
|
|
|
|
if (customerDelete) {
|
|
customerDelete.addEventListener("submit", (e) => {
|
|
const self = e.target as HTMLFormElement;
|
|
e.preventDefault();
|
|
Swal.fire({
|
|
title: trans.methods.__("Supprimer ce client pour cette marque ?"),
|
|
text: trans.methods.__("Attention cette action est irréversible, si le client n'appartient plus à aucune marque il sera complètement retiré des bases"),
|
|
color: getComputedStyle(document.body).getPropertyValue("--bs-body-color"),
|
|
icon: "warning",
|
|
showCancelButton: true,
|
|
confirmButtonText:trans.methods.__("Je comprends le danger et suis conscient de ce que je fait"),
|
|
cancelButtonText: trans.methods.__("Annuler"),
|
|
reverseButtons: true,
|
|
// * Bootstrap Styling
|
|
customClass: {
|
|
confirmButton: "btn btn-primary mx-1",
|
|
cancelButton: "btn btn-danger mx-1",
|
|
},
|
|
buttonsStyling: false,
|
|
background: getComputedStyle(document.body).getPropertyValue("--bs-body-bg"),
|
|
}).then((result) => {
|
|
if (result.isConfirmed) {
|
|
Swal.fire({
|
|
title: trans.methods.__("Attention au conséquences"),
|
|
html: "La supression de ce compte dans la crm n'entrainera pas ça supression dans MESBR ni dans le front cache DB (pour les sites WPCRM). <br><h3><b>Une fois le compte supprimé je ne pourrai plus récupérer le hashcode nécessaire pour effectuer ces opérations.</b></h3>",
|
|
color: getComputedStyle(document.body).getPropertyValue("--bs-body-color"),
|
|
icon: "warning",
|
|
showCancelButton: true,
|
|
confirmButtonText:trans.methods.__("Je comprends le danger et suis conscient que celà aura des conséquences"),
|
|
cancelButtonText: trans.methods.__("Annuler"),
|
|
reverseButtons: true,
|
|
// * Bootstrap Styling
|
|
customClass: {
|
|
confirmButton: "btn btn-primary mx-1",
|
|
cancelButton: "btn btn-danger mx-1",
|
|
},
|
|
buttonsStyling: false,
|
|
background: getComputedStyle(document.body).getPropertyValue("--bs-body-bg"),
|
|
}).then((result) => {
|
|
if (result.isConfirmed) {
|
|
self?.submit();
|
|
}
|
|
});
|
|
}
|
|
});
|
|
});
|
|
}
|