Skip to content
Snippets Groups Projects
Commit 28162eb1 authored by Lukas's avatar Lukas
Browse files

Create external function for ger search params

parent a0e0c378
No related branches found
No related tags found
1 merge request!524Lbudginas/#424 add new tab on account page
import { SearchRangesResult } from "@/hooks/common/useSearchRanges";
export const getSearchParams = async (searchRanges: SearchRangesResult) => {
const { getRangesValues } = searchRanges;
const { payloadFromBlock, payloadToBlock, payloadStartDate, payloadEndDate } =
await getRangesValues();
return {
fromBlock: payloadFromBlock,
toBlock: payloadToBlock,
startDate: payloadStartDate,
endDate: payloadEndDate,
lastBlocks:
searchRanges.rangeSelectKey === "lastBlocks"
? searchRanges.lastBlocksValue
: undefined,
lastTime: searchRanges.lastTimeUnitValue,
rangeSelectKey: searchRanges.rangeSelectKey,
timeUnit: searchRanges.timeUnitSelectKey,
};
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment