stuctured envelopa and envelopb integration
This commit is contained in:
@@ -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)
|
||||
},
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user