Skip to content

Commit b755ef9

Browse files
committed
delete all console.log
1 parent 6663035 commit b755ef9

File tree

1 file changed

+3
-23
lines changed

1 file changed

+3
-23
lines changed

src/cs_dynamicpages/browser/static/delete-row.js

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,12 @@
1818
!document.body.classList.contains("template-dynamic-view") ||
1919
!document.body.classList.contains("userrole-manager")
2020
) {
21-
console.log(
22-
"Not in dynamic-view edit mode, skipping row deletion initialization"
23-
);
2421
return;
2522
}
2623

27-
console.log("Initializing row deletion...");
28-
2924
const deleteModal = document.getElementById("deleteElementModal");
3025
if (!deleteModal) {
31-
console.error("Delete element modal not found");
26+
// Delete element modal not found
3227
return;
3328
}
3429

@@ -39,12 +34,9 @@
3934
// Get the closest parent element with data-delete-target="true"
4035
rowToDelete = button.closest('[data-delete-target="true"]');
4136
if (!rowToDelete) {
42-
console.error(
43-
'No deletable element found. Add data-delete-target="true" to the parent element you want to delete.'
44-
);
37+
// No deletable element found
4538
return;
4639
}
47-
console.log("Preparing to delete element:", rowToDelete);
4840
});
4941

5042
// Store the deletion context for modal confirmation
@@ -66,10 +58,6 @@
6658
element: elementToDelete,
6759
};
6860
// The modal will be shown by Bootstrap's data-bs-toggle="modal"
69-
} else {
70-
console.error(
71-
'No deletable element found. Add data-delete-target="true" to the parent element you want to delete.'
72-
);
7361
}
7462
}
7563
});
@@ -98,17 +86,13 @@
9886
}
9987
});
10088
} else {
101-
console.error(
102-
'Could not find confirm button with ID "confirmDeleteRow"'
103-
);
89+
// Confirm button not found
10490
}
10591
}
10692

10793
function deleteRow(elementId, elementToDelete) {
10894
const elementUrl = elementToDelete.dataset.elementurl;
10995

110-
console.log(`Deleting element ${elementId} via ${elementUrl}`);
111-
11296
fetch(elementUrl, {
11397
method: "DELETE",
11498
headers: {
@@ -120,12 +104,8 @@
120104
credentials: "same-origin",
121105
})
122106
.then((response) => {
123-
console.log(`Received response with status: ${response.status}`);
124-
console.log("Response headers:", response.headers);
125-
console.log("Response ok:", response.ok);
126107
if (!response.ok) {
127108
const error = new Error(`HTTP error! status: ${response.status}`);
128-
console.error("Response not OK:", error);
129109
throw error;
130110
}
131111
})

0 commit comments

Comments
 (0)