@@ -64,7 +66,9 @@ function displayForumPosts(posts) {
Author: ${escapeHtml(reply.author.username)}
Created: ${new Date(reply.createdAt).toLocaleString()}
-
+
@@ -96,7 +100,6 @@ function deleteForumPost(postId) {
'Authorization': `Bearer ${localStorage.getItem('token')}`
},
success: function(response) {
-// console.log('Delete post response:', response);
showAlert('success', 'Post deleted successfully.');
loadForumPosts();
},
@@ -122,7 +125,6 @@ function deleteForumReply(replyId) {
'Authorization': `Bearer ${localStorage.getItem('token')}`
},
success: function(response) {
- // console.log('Delete reply response:', response);
showAlert('success', 'Reply deleted successfully.');
loadForumPosts();
},
@@ -147,9 +149,9 @@ function getSectionName(sectionId) {
}
function showAlert(type, message) {
- const alertElement = $(`
+ const alertElement = $(`
- ${message}
+ ${type === 'success' ? 'Success!' : 'Error!'} ${message}
`);
$('#content-area').prepend(alertElement);
setTimeout(() => alertElement.alert('close'), 5000);