BugFix: saving location did not redirect user
This commit is contained in:
@@ -23,7 +23,7 @@ export type LocationEditFormProps = {
|
|||||||
export const LocationEditForm:FC<LocationEditFormProps> = ({ location, yearMonth }) =>
|
export const LocationEditForm:FC<LocationEditFormProps> = ({ location, yearMonth }) =>
|
||||||
{
|
{
|
||||||
const initialState = { message: null, errors: {} };
|
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);
|
const [ state, dispatch ] = useFormState(handleAction, initialState);
|
||||||
|
|
||||||
let { year, month } = location ? location.yearMonth : yearMonth;
|
let { year, month } = location ? location.yearMonth : yearMonth;
|
||||||
|
|||||||
Reference in New Issue
Block a user