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

@@ -3,7 +3,7 @@ using WebApp.Entities;
namespace WebApp.DTOs;
// Output values in JSON file
// Input values in JSON file
public record class EventSearchDto
(
int? OrganisationId,

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 {

View File

@@ -72,10 +72,6 @@
<label for="eventDate">Data</label>
<input id="eventDate" type="datetime-local" class="form-control input-field" />
</div>
<div class="form-group mb-4">
<label for="organisationId">ID Organizacji</label>
<input id="organisationId" type="number" class="form-control input-field" />
</div>
<button id="saveBtn" class="button"><span>Save</span><span>&#11166;</span></button>