Unified Category modal

This commit is contained in:
2023-05-15 22:10:32 +02:00
parent 4bfd71f09f
commit 0c7c294823
2 changed files with 17 additions and 41 deletions

View File

@ -31,6 +31,20 @@ function getDataForEdit(name) {
});
}
function primeCreateNew() {
const form = document.getElementById('CategoryModalForm');
form.setAttribute('method', 'POST');
document.getElementById('editCategoryModalLabel').innerText = 'Create a new category';
return true;
}
function primeEdit() {
const form = document.getElementById('CategoryModalForm');
document.getElementById('editCategoryModalLabel').innerText = 'Edit category';
form.setAttribute('method', 'PATCH');
return true;
}
function deleteEntry(id) {
$.ajax({
type: 'delete',