mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
20 lines
465 B
TypeScript
20 lines
465 B
TypeScript
import { parse } from "qs";
|
|
import type { ParsedParams } from "@refinedev/core";
|
|
|
|
export const parseTableParams = (search: string) => {
|
|
const parsed: ParsedParams = parse(search, { ignoreQueryPrefix: true });
|
|
|
|
const tableReady = {
|
|
...parsed,
|
|
pagination: {
|
|
current: parsed.current,
|
|
pageSize: parsed.pageSize,
|
|
},
|
|
};
|
|
|
|
delete tableReady.current;
|
|
delete tableReady.pageSize;
|
|
|
|
return tableReady;
|
|
};
|