fix: settings error message
This commit is contained in:
parent
b5602bead5
commit
2a95836dcb
3 changed files with 29 additions and 17 deletions
|
@ -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('');
|
||||
|
|
|
@ -98,7 +98,7 @@ export default function AccountTab() {
|
|||
toast.custom((t) => (
|
||||
<ToastInner
|
||||
toastId={t}
|
||||
title='Settings saved'
|
||||
title='Error saving settings'
|
||||
description={
|
||||
error.response?.data.message || 'An unknown error occurred.'
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue