diff --git a/packages/generator-overreact-odata/src/templates/hooks/use-coll.ejs b/packages/generator-overreact-odata/src/templates/hooks/use-coll.ejs index 85b8447..c328160 100644 --- a/packages/generator-overreact-odata/src/templates/hooks/use-coll.ejs +++ b/packages/generator-overreact-odata/src/templates/hooks/use-coll.ejs @@ -35,7 +35,14 @@ export function <%- hookName %>(variables, config = {}) { create: createConfig, } = defaultConfig; - const [data, paginationMethods] = usePagination(dataRefId, fetchSpec, paginationConfig); + const expandedPaginationConfig = useMemo(() => ({ + fetchVariables: { + ...variables, + }, + ...paginationConfig, + }), [variables, paginationConfig]); + + const [data, paginationMethods] = usePagination(dataRefId, fetchSpec, expandedPaginationConfig); const mutateFn = useMutation(dataRefId, mutationSpec, mutationConfig); const destroyFn = useMutation(dataRefId, destroySpec, destroyConfig); const createFn = useMutation(dataRefId, addSpec, createConfig); diff --git a/packages/generator-overreact-odata/src/templates/root/index.ejs b/packages/generator-overreact-odata/src/templates/root/index.ejs index 1e8dc47..b35fb4e 100644 --- a/packages/generator-overreact-odata/src/templates/root/index.ejs +++ b/packages/generator-overreact-odata/src/templates/root/index.ejs @@ -1,5 +1,6 @@ export { middlewares, getEnvironmentInstance } from './env/env-instance'; export { getRequestor } from './env/requestor'; +export { schema } from './env/schema'; // exports all available data hooks produced by overreact-odata <% for (const e of exports) { %>