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

@@ -21,7 +21,9 @@
card.className = "event-card filled"; card.className = "event-card filled";
card.innerHTML = ` card.innerHTML = `
<span>${ev.title}</span> <span>${ev.title}</span>
<button class="remove-btn delete-btn" data-id="${ev.eventId}"></button> <button class="remove-btn delete-btn" data-id="${ev.eventId}">
<svg xmlns="http://www.w3.org/2000/svg" height="30px" viewBox="0 -960 960 960" width="30px" fill="#FFFFFF"><path d="M280-440h400v-80H280v80ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z"/></svg>
</button>
`; `;
container.appendChild(card); container.appendChild(card);
} }

View File

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

View File

@@ -28,7 +28,9 @@ document.addEventListener("DOMContentLoaded", () => __awaiter(void 0, void 0, vo
card.className = "event-card filled"; card.className = "event-card filled";
card.innerHTML = ` card.innerHTML = `
<span>${ev.title}</span> <span>${ev.title}</span>
<button class="remove-btn delete-btn" data-id="${ev.eventId}"><svg xmlns="http://www.w3.org/2000/svg" height="30px" viewBox="0 -960 960 960" width="30px" fill="#FFFFFF"><path d="M280-440h400v-80H280v80ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z"/></svg></button> <button class="remove-btn delete-btn" data-id="${ev.eventId}">
<svg xmlns="http://www.w3.org/2000/svg" height="30px" viewBox="0 -960 960 960" width="30px" fill="#FFFFFF"><path d="M280-440h400v-80H280v80ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z"/></svg>
</button>
`; `;
container.appendChild(card); container.appendChild(card);
} }

View File

@@ -7,5 +7,6 @@
"outDir": "WebApp/wwwroot/js", "outDir": "WebApp/wwwroot/js",
"lib": [ "es2015", "dom" ] "lib": [ "es2015", "dom" ]
}, },
"include": [ "WebApp/ts/**/*" ] "include": [ "WebApp/ts/**/*" ],
"compileOnSave": true
} }