diff --git a/WebApp/ts/eventList.ts b/WebApp/ts/eventList.ts index 338490f..d5cd6a3 100644 --- a/WebApp/ts/eventList.ts +++ b/WebApp/ts/eventList.ts @@ -21,7 +21,9 @@ card.className = "event-card filled"; card.innerHTML = ` ${ev.title} - + `; container.appendChild(card); } diff --git a/WebApp/wwwroot/js/eventCreate.js b/WebApp/wwwroot/js/eventCreate.js index 2013e47..6dab6eb 100644 --- a/WebApp/wwwroot/js/eventCreate.js +++ b/WebApp/wwwroot/js/eventCreate.js @@ -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', { diff --git a/WebApp/wwwroot/js/eventList.js b/WebApp/wwwroot/js/eventList.js index e23a9af..66fa15e 100644 --- a/WebApp/wwwroot/js/eventList.js +++ b/WebApp/wwwroot/js/eventList.js @@ -28,7 +28,9 @@ document.addEventListener("DOMContentLoaded", () => __awaiter(void 0, void 0, vo card.className = "event-card filled"; card.innerHTML = ` ${ev.title} - + `; container.appendChild(card); } diff --git a/tsconfig.json b/tsconfig.json index 0067f3c..50593f7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,5 +7,6 @@ "outDir": "WebApp/wwwroot/js", "lib": [ "es2015", "dom" ] }, - "include": [ "WebApp/ts/**/*" ] + "include": [ "WebApp/ts/**/*" ], + "compileOnSave": true }