fix: settings error message
Some checks failed
container-scan / Container Scan (pull_request) Successful in 2m32s
tests / Tests (pull_request) Has been cancelled
docker-build / docker (pull_request) Successful in 3m41s

This commit is contained in:
Dominik 2025-07-01 08:59:22 +02:00
parent b5602bead5
commit 2a95836dcb
Signed by: dominik
GPG key ID: 06A4003FC5049644
3 changed files with 29 additions and 17 deletions

View file

@ -58,14 +58,11 @@ const EventForm: React.FC<EventFormProps> = (props) => {
error,
} = usePostApiEvent();
const { data, isLoading, error: fetchError } = useGetApiUserMe();
const { data: eventData } = useGetApiEventEventID(
props.eventId!,
{
query: { enabled: props.type === 'edit' },
},
);
const { data: eventData } = useGetApiEventEventID(props.eventId!, {
query: { enabled: props.type === 'edit' },
});
const patchEvent = usePatchApiEventEventID();
const router = useRouter();;
const router = useRouter();
// State for date and time fields
const [startDate, setStartDate] = React.useState<Date | undefined>(undefined);
@ -102,7 +99,9 @@ const EventForm: React.FC<EventFormProps> = (props) => {
}
setLocation(eventData?.data?.event.location || '');
setDescription(eventData?.data?.event.description || '');
setSelectedParticipants(eventData?.data?.event.participants?.map((u) => u.user) || []);
setSelectedParticipants(
eventData?.data?.event.participants?.map((u) => u.user) || [],
);
} else if (props.type === 'create' && startFromUrl && endFromUrl) {
// If creating a new event with URL params, set title and dates
setTitle('');