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; namespace WebApp.DTOs;
// Output values in JSON file // Input values in JSON file
public record class EventSearchDto public record class EventSearchDto
( (
int? OrganisationId, int? OrganisationId,

View File

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

View File

@@ -72,10 +72,6 @@
<label for="eventDate">Data</label> <label for="eventDate">Data</label>
<input id="eventDate" type="datetime-local" class="form-control input-field" /> <input id="eventDate" type="datetime-local" class="form-control input-field" />
</div> </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> <button id="saveBtn" class="button"><span>Save</span><span>&#11166;</span></button>