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