@hisptz/react-ui
Version:
A collection of reusable complex DHIS2 react ui components.
21 lines (18 loc) • 619 B
JavaScript
import { get } from "lodash";
import { OFFLINE_ORG_UNIT_PAGE_SIZE } from "../constants/config";
async function getPagination(engine, query, _ref) {
var _options$pageSize;
let {
options,
queryKey
} = _ref;
const data = await engine.query(query, {
variables: { ...options,
pageSize: (_options$pageSize = options === null || options === void 0 ? void 0 : options.pageSize) !== null && _options$pageSize !== void 0 ? _options$pageSize : OFFLINE_ORG_UNIT_PAGE_SIZE,
totalPages: true,
skipData: true
}
});
return get(data, [queryKey, "pager"], {});
}
export { getPagination };