form action redirects user to tjhe appropriate year
This commit is contained in:
@@ -5,9 +5,9 @@ import { FC } from "react";
|
||||
import { BillingLocation, YearMonth } from "../lib/db-types";
|
||||
import { updateOrAddLocation } from "../lib/actions/locationActions";
|
||||
import { useFormState } from "react-dom";
|
||||
import { gotoHome } from "../lib/actions/billActions";
|
||||
import { Main } from "./Main";
|
||||
import Link from "next/link";
|
||||
import { gotoHome } from "../lib/actions/navigationActions";
|
||||
|
||||
export interface LocationEditFormProps {
|
||||
/** location which should be edited */
|
||||
@@ -25,7 +25,7 @@ export const LocationEditForm:FC<LocationEditFormProps> = ({ location, yearMonth
|
||||
// redirect to the main page
|
||||
const handleCancel = () => {
|
||||
console.log('handleCancel');
|
||||
gotoHome();
|
||||
gotoHome(location ? `/?year=${location?.yearMonth?.year}` : undefined);
|
||||
};
|
||||
|
||||
return(
|
||||
|
||||
Reference in New Issue
Block a user