UNPKG

@hisptz/react-ui

Version:

A collection of reusable complex DHIS2 react ui components.

27 lines (22 loc) 717 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getPagination = getPagination; var _lodash = require("lodash"); var _config = require("../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 : _config.OFFLINE_ORG_UNIT_PAGE_SIZE, totalPages: true, skipData: true } }); return (0, _lodash.get)(data, [queryKey, "pager"], {}); }