mirror of
https://github.com/GCMatters/hermes.git
synced 2026-02-04 13:40:13 +01:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user