import { DEFAULT_PAGINATOR, IPaginatorOptions } from '../interfaces/collaterals.interface';

export const getPaginator = (request): IPaginatorOptions => {
  const paginator = { ...DEFAULT_PAGINATOR };
  if (request.pageIndex) {
    paginator.pageIndex = +request.pageIndex;
  }
  if (request.pageSize) {
    paginator.pageSize = +request.pageSize;
  }
  return paginator;
}
