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:
@@ -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,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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>⮞</span></button>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user