stuctured envelopa and envelopb integration
This commit is contained in:
+12
-24
@@ -1,5 +1,5 @@
|
||||
import { useInfiniteQuery, useMutation, useQuery } from '@tanstack/react-query';
|
||||
import { fetchDashboard, fetchLiveAuction, fetchLiveTender, fetchPurchaseAuction, fetchPurchaseTender, offlineAuctionPurchase, userLogin, offlineTenderPurchase, fetchTenderById, proceedToBid, submitEnvelopeA, submitEnvelopeB } from './apis';
|
||||
import { fetchDashboard, fetchLiveAuction, fetchLiveTender, fetchPurchaseAuction, fetchPurchaseTender, offlineAuctionPurchase, userLogin, offlineTenderPurchase, fetchTenderById, proceedToBid, submitEnvelopeA, submitEnvelopeB, uploadEnvelopeFile, UploadArgs } from './apis';
|
||||
import { ToastAndroid } from 'react-native';
|
||||
|
||||
// User
|
||||
@@ -32,7 +32,7 @@ export const useFetchPurchaseTender = () => {
|
||||
getNextPageParam: (lastPage, allPages) => {
|
||||
console.log('last page : ', lastPage)
|
||||
console.log("all page : ", allPages)
|
||||
const {totalCount } = lastPage;
|
||||
const { totalCount } = lastPage;
|
||||
|
||||
const totalPages = Math.ceil(totalCount / 10);
|
||||
const nextPage = allPages.length;
|
||||
@@ -122,29 +122,17 @@ export const useProceedToBid = (tenderId?: string) => {
|
||||
};
|
||||
|
||||
|
||||
export const useSubmitEnvelopeA = (onSuccessCallback?: () => void) => {
|
||||
return useMutation({
|
||||
export const useSubmitEnvelopeA = () =>
|
||||
useMutation({
|
||||
mutationFn: submitEnvelopeA,
|
||||
onSuccess: (data) => {
|
||||
ToastAndroid.show(data?.message || 'Submitted successfully', ToastAndroid.SHORT)
|
||||
onSuccessCallback?.()
|
||||
},
|
||||
onError: (error: any) => {
|
||||
console.log('Envelope A submit error:', error)
|
||||
ToastAndroid.show('Something went wrong', ToastAndroid.SHORT)
|
||||
},
|
||||
})
|
||||
}
|
||||
export const useSubmitEnvelopeB = (onSuccessCallback?: () => void) => {
|
||||
return useMutation({
|
||||
|
||||
export const useSubmitEnvelopeB = () =>
|
||||
useMutation({
|
||||
mutationFn: submitEnvelopeB,
|
||||
onSuccess: (data) => {
|
||||
ToastAndroid.show(data?.message || 'Submitted successfully', ToastAndroid.SHORT)
|
||||
onSuccessCallback?.()
|
||||
},
|
||||
onError: (error: any) => {
|
||||
console.log('Envelope A submit error:', error)
|
||||
ToastAndroid.show('Something went wrong', ToastAndroid.SHORT)
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
export const useUploadEnvelopeFile = () =>
|
||||
useMutation({
|
||||
mutationFn: uploadEnvelopeFile,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user