import { createHandlerChainRunner, Handler } from "@insite/client-framework/HandlerCreator";

type HandlerType = Handler<{ poNumber: string }>;

export const DispatchSetPONumber: HandlerType = props => {
    props.dispatch({
        type: "Pages/CheckoutReviewAndSubmit/SetPONumber",
        poNumber: props.parameter.poNumber,
    });
};

export const chain = [DispatchSetPONumber];

const setPONumber = createHandlerChainRunner(chain, "SetPONumber");
export default setPONumber;
