refactoring: changing param list of a fn

This commit is contained in:
2024-02-01 15:07:30 +01:00
parent a1abc450bf
commit 2261e83715
8 changed files with 26 additions and 18 deletions

View File

@@ -2,7 +2,6 @@
import { FC } from "react";
import { Bill, BillingLocation } from "../lib/db-types";
import { deleteLocationById } from "../lib/actions/locationActions";
import { useFormState } from "react-dom";
import { Main } from "./Main";
import { gotoHome } from "../lib/actions/navigationActions";
@@ -15,11 +14,11 @@ export interface BillDeleteFormProps {
export const BillDeleteForm:FC<BillDeleteFormProps> = ({ bill, location }) =>
{
const handleAction = deleteBillById.bind(null, location._id, bill._id, location.yearMonth.year);
const handleAction = deleteBillById.bind(null, location._id, bill._id, location.yearMonth.year, location.yearMonth.month);
const [ state, dispatch ] = useFormState(handleAction, null);
const handleCancel = () => {
gotoHome(`/?year=${location.yearMonth.year}&month=${location.yearMonth.month}`);
gotoHome(location.yearMonth);
};
return(