import { createHandlerChainRunnerOptionalParameter, Handler } from "@insite/client-framework/HandlerCreator";
import { GetWishListsApiParameter } from "@insite/client-framework/Services/WishListService";
import loadWishListsData from "@insite/client-framework/Store/Data/WishLists/Handlers/LoadWishLists";

type HandlerType = Handler;

export const wishListsParameter: GetWishListsApiParameter = {
    filter: "availableToAdd",
    pageSize: 999,
    expand: ["favorite", "hidden"],
};

export const DispatchLoadWishLists: HandlerType = props => {
    props.dispatch(loadWishListsData(wishListsParameter));
};

export const chain = [DispatchLoadWishLists];

const loadWishLists = createHandlerChainRunnerOptionalParameter(chain, {}, "LoadWishLists");
export default loadWishLists;
