stuctured envelopa and envelopb integration

This commit is contained in:
Jaanu423
2026-01-09 15:34:10 +05:30
parent 0e93334941
commit fa8303fb89
6 changed files with 263 additions and 75 deletions
+28 -1
View File
@@ -1,5 +1,6 @@
import { useInfiniteQuery, useMutation, useQuery } from '@tanstack/react-query';
import { fetchDashboard, fetchLiveAuction, fetchLiveTender, fetchPurchaseAuction, fetchPurchaseTender, offlineAuctionPurchase, userLogin, offlineTenderPurchase, fetchTenderById, proceedToBid } from './apis';
import { fetchDashboard, fetchLiveAuction, fetchLiveTender, fetchPurchaseAuction, fetchPurchaseTender, offlineAuctionPurchase, userLogin, offlineTenderPurchase, fetchTenderById, proceedToBid, submitEnvelopeA, submitEnvelopeB } from './apis';
import { ToastAndroid } from 'react-native';
// User
@@ -121,3 +122,29 @@ export const useProceedToBid = (tenderId?: string) => {
};
export const useSubmitEnvelopeA = (onSuccessCallback?: () => void) => {
return 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({
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)
},
})
}