refactoring: changing param list of a fn
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user