This commit is contained in:
@@ -286,7 +286,7 @@ async function addComment(eventId, el) {
|
|||||||
const input = container.querySelector('.comment-input');
|
const input = container.querySelector('.comment-input');
|
||||||
const body = input.value.trim();
|
const body = input.value.trim();
|
||||||
if (!body) return;
|
if (!body) return;
|
||||||
const author = prompt('Your name:') || 'Anonymous';
|
const author = currentUser || 'Anonymous';
|
||||||
await apiFetch('comments', { method: 'POST', body: JSON.stringify({ event_id: eventId, author, body }) });
|
await apiFetch('comments', { method: 'POST', body: JSON.stringify({ event_id: eventId, author, body }) });
|
||||||
input.value = '';
|
input.value = '';
|
||||||
loadEvents();
|
loadEvents();
|
||||||
|
|||||||
Reference in New Issue
Block a user