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