mirror of
https://github.com/GCMatters/hermes.git
synced 2026-02-04 13:40:13 +01:00
fix: typescript code now regenerates after save
This commit is contained in:
@@ -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', {
|
||||
|
||||
Reference in New Issue
Block a user