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)
},
})
}
+14 -1
View File
@@ -1,5 +1,5 @@
import axios from "axios";
import { DASHBOARD_COUNT, GET_MY_AUCTION, GET_MY_TENDER, GET_TENDER_DETAILS, LIVE_AUCTION, LIVE_TENDER, LOG_IN_URL, PROCEED_PURCHASE_AUCTION, PROCEED_TO_BID, PURCHASE_TENDER_OFFLINE, TENDER_LOGIN } from "./ApiUrls";
import { DASHBOARD_COUNT, GET_MY_AUCTION, GET_MY_TENDER, GET_TENDER_DETAILS, LIVE_AUCTION, LIVE_TENDER, LOG_IN_URL, PROCEED_PURCHASE_AUCTION, PROCEED_TO_BID, PURCHASE_TENDER_OFFLINE, SUBMIT_ENVELOPE_A, SUBMIT_ENVELOPE_B, SUBMIT_ENVELOPE_FILE_A, SUBMIT_ENVELOPE_FILE_B, TENDER_LOGIN } from "./ApiUrls";
import { apiCall } from "../../Axios/Axios";
// User
@@ -83,3 +83,16 @@ export const proceedToBid = async (tenderId: string): Promise<any> => {
);
return data;
}
export const submitEnvelopeA = async (payload: any) => {
const { data } = await apiCall<any>('post', SUBMIT_ENVELOPE_A, payload)
return data
}
export const submitEnvelopeB = async (payload: any) => {
const { data } = await apiCall<any>('post', SUBMIT_ENVELOPE_B, payload)
return data
}
export const submitEnvelopeFileB = async (payload: any) => {
const { data } = await apiCall<any>('post', SUBMIT_ENVELOPE_FILE_B, payload)
return data
}