2023-05-18 23:42:48 +04:00
|
|
|
|
const goToPageBtn = document.getElementById("go-button");
|
|
|
|
|
const removeButtons = document.querySelectorAll(".remove-btn");
|
|
|
|
|
|
|
|
|
|
removeButtons.forEach(function (button) {
|
|
|
|
|
button.addEventListener("click", function (event) {
|
|
|
|
|
var id = this.dataset.id;
|
|
|
|
|
|
|
|
|
|
var result = confirm("Вы уверены, что хотите удалить эту запись?");
|
|
|
|
|
if (result) {
|
|
|
|
|
$.ajax({
|
2023-05-19 13:20:14 +04:00
|
|
|
|
url: "/specializations/delete",
|
2023-05-18 23:42:48 +04:00
|
|
|
|
type: "POST",
|
|
|
|
|
data: { Id: id }
|
|
|
|
|
}).done(() => {
|
|
|
|
|
window.location.reload();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|