chore: get rid of organizationId from payload on event creation view

it's redundant and inferred from the user's token
This commit is contained in:
2025-05-18 17:12:18 +02:00
parent b5838cbac1
commit 1eb104945a
3 changed files with 2 additions and 9 deletions

View File

@@ -6,23 +6,20 @@ async function createEvent() {
const location = (document.getElementById('location') as HTMLInputElement).value;
const description = (document.getElementById('description') as HTMLTextAreaElement).value;
const eventDateRaw = (document.getElementById('eventDate') as HTMLInputElement).value;
const organisationIdRaw = (document.getElementById('organisationId') as HTMLInputElement).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 {