<script type="text/javascript">
    const buttonModals = document.getElementsByClassName('button-delete');
    const exampleModal = document.getElementById('modalDelete');

    for (var i = 0; i < buttonModals.length; i++) {
        buttonModals[i].addEventListener("click", (e) => {
           const button = e.currentTarget;
           console.log("pencet");
           const objectName = button.getAttribute('data-mdb-object_name');
           const objectDeleteUrl = button.getAttribute('data-mdb-object_delete_url');

            const modalTitle = exampleModal.querySelector('#object_name');
            const buttonDelete = exampleModal.querySelector('#confirmDeleteButton');
            buttonDelete.href = objectDeleteUrl;
            modalTitle.textContent = objectName;
        });
    }
</script>