21 lines
673 B
JavaScript
21 lines
673 B
JavaScript
const goToPageBtn = document.getElementById("go-button");
|
|
const removeButtons = document.querySelectorAll(".remove-btn");
|
|
|
|
console.log(removeButtons)
|
|
|
|
removeButtons.forEach(function (button) {
|
|
button.addEventListener("click", function (event) {
|
|
var id = this.dataset.id;
|
|
console.log(id)
|
|
var result = confirm("Вы уверены, что хотите удалить эту запись?");
|
|
if (result) {
|
|
$.ajax({
|
|
url: "/lawyers/delete",
|
|
type: "POST",
|
|
data: { Id: id }
|
|
}).done(() => {
|
|
window.location.reload();
|
|
});
|
|
}
|
|
});
|
|
}); |