diff --git a/frontend/assets/js/app.js b/frontend/assets/js/app.js index d637ed7..4fd8fdc 100644 --- a/frontend/assets/js/app.js +++ b/frontend/assets/js/app.js @@ -128,7 +128,7 @@ function renderTimeline() { ${renderComments(e)}
- +
@@ -154,8 +154,9 @@ function renderComments(event) { `).join(''); } -async function addComment(eventId, btn) { - const input = btn.parentElement.querySelector('.comment-input'); +async function addComment(eventId, el) { + const container = el.closest('.comment-input-group') || el.parentElement; + const input = container.querySelector('.comment-input'); const body = input.value.trim(); if (!body) return; const author = prompt('Your name:') || 'Anonymous'; @@ -174,7 +175,7 @@ async function saveEvent() { description: document.getElementById('eventDescription').value, severity: document.getElementById('eventSeverity').value, event_type: document.getElementById('eventType').value, - occurred_at: document.getElementById('eventTime').value || new Date().toISOString().slice(0, 16) + occurred_at: new Date().toISOString().slice(0, 16) }; if (!data.title) return alert('Title required'); await apiFetch('events', { method: 'POST', body: JSON.stringify(data) });