adding new billing location completed
This commit is contained in:
@@ -9,13 +9,15 @@ import { gotoHome } from "../lib/billActions";
|
||||
|
||||
export interface LocationEditFormProps {
|
||||
/** location which should be edited */
|
||||
location?: BillingLocation
|
||||
location?: BillingLocation,
|
||||
/** year month at a new billing location should be assigned */
|
||||
yearMonth?: string
|
||||
}
|
||||
|
||||
export const LocationEditForm:FC<LocationEditFormProps> = ({ location }) =>
|
||||
export const LocationEditForm:FC<LocationEditFormProps> = ({ location, yearMonth }) =>
|
||||
{
|
||||
const initialState = { message: null, errors: {} };
|
||||
const handleAction = updateOrAddLocation.bind(null, location?._id);
|
||||
const handleAction = updateOrAddLocation.bind(null, location?._id, yearMonth);
|
||||
const [ state, dispatch ] = useFormState(handleAction, initialState);
|
||||
|
||||
// redirect to the main page
|
||||
|
||||
Reference in New Issue
Block a user