fix: typescript code now regenerates after save

This commit is contained in:
2025-05-18 18:47:10 +02:00
parent 69c508ef84
commit 8ffb7f4eff
4 changed files with 9 additions and 7 deletions

View File

@@ -16,20 +16,17 @@ function createEvent() {
const location = document.getElementById('location').value;
const description = document.getElementById('description').value;
const eventDateRaw = document.getElementById('eventDate').value;
const organisationIdRaw = document.getElementById('organisationId').value;
// Walidacja prostych pól
if (!title || !location || !eventDateRaw || !organisationIdRaw) {
if (!title || !location || !eventDateRaw) {
alert("Uzupełnij wszystkie wymagane pola!");
return;
}
const eventDate = new Date(eventDateRaw).toISOString();
const organisationId = parseInt(organisationIdRaw);
const payload = {
title,
location,
description,
eventDate,
organisationId
};
try {
const response = yield fetch('/api/events', {