commiting

This commit is contained in:
Abin Toppo
2026-01-16 11:24:24 +05:30
parent 86ebc5d00e
commit b0fb9f7616
4 changed files with 15 additions and 8 deletions
+8 -5
View File
@@ -5,8 +5,9 @@ import colors from '../../Constant/Color';
import { CreditCard, Calendar, User, DollarSign, ArrowRight } from 'lucide-react-native';
import { useSelector } from 'react-redux';
import { useOfflineTenderPurchase } from '../../Services/BBPS/Hooks';
import { useNavigation } from '@react-navigation/native';
import { StackActions, useNavigation } from '@react-navigation/native';
import NavigationString from '../../Constant/NavigationString';
import { showErrorAlert, showToast } from '../../Constant/ShowDailog';
const ProceedToPurTender = () => {
const navigation: any = useNavigation();
@@ -52,11 +53,13 @@ const ProceedToPurTender = () => {
mutate(body, {
onSuccess: (res) => {
console.log(res, '---------------------purchsase response');
Alert.alert('Offline Purchase Successful!', `Order No: ${orderNo}`);
navigation.goBack()
if(res.statusCode === 200 ){
showToast(res.message);
navigation.dispatch(StackActions.pop(2));
}
},
onError: (error) => {
showErrorAlert('Something went wrong');
console.log(error, "================purchse Error");
}
})
@@ -70,7 +73,7 @@ const ProceedToPurTender = () => {
setLoading(true);
setTimeout(() => {
setLoading(false);
type === 'online' ? Alert.alert('Online Purchase Successful!') : handleOfflinePurchase();
type === 'online' ? showErrorAlert('Online Purchase is disabled') : handleOfflinePurchase();
}, 1200);
};
@@ -40,6 +40,7 @@ interface InfoRowProps {
const TenderBidding = () => {
const route = useRoute<any>();
const navigation = useNavigation();
console.log("-=-=-=-=-=",route)
const [bidData] = useState<any>(route.params?.tenderData || null);
const tenderData: any = route.params?.bidData || null;
const [activeEnvelope, setActiveEnvelope] = useState<EnvelopeType>('A');
@@ -317,12 +318,15 @@ const TenderBidding = () => {
const handleSubmitEnvelopeA = async () => {
console.log("hitting here ",envelopForm?.[activeEnvelope])
if (!validateEnvelope()) {
Alert.alert('Validation Error', 'Please fill all mandatory fields');
return;
}
const payload = buildEnvelopePayload();
if (envelopForm?.[activeEnvelope]?.[3]) {
console.log("----",)
const result = await handleSubmitEnvelopeFile(SUBMIT_ENVELOPE_FILE_A)
if (result && result?.statusCode === 200) {
+1 -1
View File
@@ -103,7 +103,7 @@ export const fetchAuctionItem = async (payload: any): Promise<any> => {
export const offlineTenderPurchase = async (payload: any): Promise<any> => {
try {
const response = await apiCall<any>('post', PURCHASE_TENDER_OFFLINE, payload);
return response.data;
return response;
} catch (error: any) {
throw error.response?.data || error.message;
}