BugFix: saving location did not redirect user

This commit is contained in:
2024-02-06 15:07:52 +01:00
parent 4ef2330ad4
commit 79e8e1279c

View File

@@ -23,7 +23,7 @@ export type LocationEditFormProps = {
export const LocationEditForm:FC<LocationEditFormProps> = ({ location, yearMonth }) =>
{
const initialState = { message: null, errors: {} };
const handleAction = updateOrAddLocation.bind(null, location?._id, yearMonth);
const handleAction = updateOrAddLocation.bind(null, location?._id, location?.yearMonth ?? yearMonth);
const [ state, dispatch ] = useFormState(handleAction, initialState);
let { year, month } = location ? location.yearMonth : yearMonth;