latest code with fix modal back Press problem

This commit is contained in:
rohit-kumar-fullstack
2026-01-13 11:53:07 +05:30
parent ffc7e4ead0
commit aa740a608e
11 changed files with 190 additions and 164 deletions
+31 -1
View File
@@ -1,5 +1,5 @@
import { useInfiniteQuery, useMutation, useQuery } from '@tanstack/react-query';
import { fetchAuctionItem, fetchDashboard, fetchEmdCheck, fetchLiveAuction, fetchLiveTender, fetchPurchaseAuction, fetchPurchaseAuctionList, fetchPurchaseTender, getAuction, offlineAuctionPurchase, userLogin, offlineTenderPurchase, fetchTenderById, proceedToBid, viewAuctionDocumentDownload, viewAuctionDocuments, viewAuctionItemDocuments } from './apis';
import { fetchAuctionItem, fetchDashboard, fetchEmdCheck, fetchLiveAuction, fetchLiveTender, fetchPurchaseAuction, fetchPurchaseAuctionList, fetchPurchaseTender, getAuction, offlineAuctionPurchase, userLogin, offlineTenderPurchase, fetchTenderById, proceedToBid, viewAuctionDocumentDownload, viewAuctionDocuments, viewAuctionItemDocuments, fetchPurchaseAuctionPage } from './apis';
// User
@@ -63,6 +63,36 @@ export const useFetchPurchaseAuction = () => {
});
};
export const useFetchLiveAuctionPage = () => {
return useInfiniteQuery<any>({
queryKey: ['fetchPurchaseAuctionPage'],
queryFn: ({ pageParam = 0 }) =>
fetchPurchaseAuctionPage({
page: pageParam,
size: 10,
}),
initialPageParam: 0,
getNextPageParam: (lastPage, allPages) => {
const { size, totalCount } = lastPage;
const totalPages = Math.ceil(totalCount / size);
const nextPage = allPages.length;
return nextPage < totalPages ? nextPage : undefined;
},
select: (data) => {
const mergedResults = data.pages.flatMap(
(page: any) => page?.data ?? []
);
return {
...data,
result: mergedResults,
};
},
});
};
export const useFetchLiveAuction = () => {
return useInfiniteQuery<any>({
queryKey: ['fetchLiveAuction'],