From 79e8e1279c25697410a8c30207cb1ade9db0be34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Dere=C5=BEi=C4=87?= Date: Tue, 6 Feb 2024 15:07:52 +0100 Subject: [PATCH] BugFix: saving location did not redirect user --- app/ui/LocationEditForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/ui/LocationEditForm.tsx b/app/ui/LocationEditForm.tsx index 5dfb14c..9b4aa27 100644 --- a/app/ui/LocationEditForm.tsx +++ b/app/ui/LocationEditForm.tsx @@ -23,7 +23,7 @@ export type LocationEditFormProps = { export const LocationEditForm:FC = ({ 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;