Merge branch 'main' of https://git.zeptic.in/rohit/Procurelinc into etenderMerge

This commit is contained in:
Abin Toppo
2026-01-12 18:15:55 +05:30
47 changed files with 1794 additions and 1252 deletions
+13 -10
View File
@@ -62,6 +62,7 @@ export const useFetchLiveTender = () => {
queryFn: () => fetchLiveTender()
});
};
export const useFetchPurchaseAuction = () => {
return useQuery({
queryKey: ['fetchPurchaseAuction',],
@@ -69,25 +70,28 @@ export const useFetchPurchaseAuction = () => {
});
};
export const useFetchLiveAuction = () => {
return useInfiniteQuery<any>({
queryKey: ['fetchLiveAuction',],
queryFn: ({ pageParam = 1 }) =>
queryKey: ['fetchLiveAuction'],
queryFn: ({ pageParam = 0 }) =>
fetchLiveAuction({
page: pageParam,
size: 10,
}),
initialPageParam: 1,
getNextPageParam: (lastPage) => {
const { page, size, totalCount } = lastPage;
initialPageParam: 0,
getNextPageParam: (lastPage, allPages) => {
const { size, totalCount } = lastPage;
const totalPages = Math.ceil(totalCount / size);
const nextPage = page + 1;
const nextPage = allPages.length;
return nextPage < totalPages ? nextPage : undefined;
},
select: (data) => {
const mergedResults = data.pages.flatMap((page: any) => page.data ?? []);
select: (data) => {
const mergedResults = data.pages.flatMap(
(page: any) => page?.data ?? []
);
return {
...data,
result: mergedResults,
@@ -97,7 +101,6 @@ export const useFetchLiveAuction = () => {
};
// Auction Purchase offline
export const useOfflineAuctionPurchase = () => {