This commit is contained in:
Abin Toppo
2026-01-14 15:13:51 +05:30
16 changed files with 186 additions and 141 deletions
+4 -7
View File
@@ -1,14 +1,11 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> <manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<!-- Android 12 and below --> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="28" />
<!-- Android 13+ --> <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" /> <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" /> <uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
<application <application
android:name=".MainApplication" android:name=".MainApplication"
+9 -8
View File
@@ -12,7 +12,6 @@ export const apiCall = async <R, D = {}>(
try { try {
const token: any = store.getState().token.token; const token: any = store.getState().token.token;
console.log("abin-------",url)
const response = await axios({ const response = await axios({
method, method,
url, url,
@@ -24,24 +23,26 @@ export const apiCall = async <R, D = {}>(
}, },
}); });
console.log("abin-------",response)
return response.data; return response.data;
} catch (error: any) { } catch (error: any) {
const errorMessage = error?.response?.data?.error; const errorMessage = error?.response?.data?.error;
console.log(errorMessage, '---------------------------api error message'); // console.log(error?.response?.data.error, '---------------------------api error message');
if (error?.response?.status === 401) { if (error?.response?.statusCode === 401) {
store.dispatch(setToken({})); store.dispatch(setToken({}));
return { return {
success: false, success: false,
message: 'JWT Error - Token expired or malformed', message: 'JWT Error - Token expired or malformed',
} as R; } as R;
} }
const data = {
return { data: {
success: false, success: false,
message: error?.response?.data?.message || 'No Response From Server', message: error?.response?.data?.message || 'No Response From Server',
} as R; }
}
return data as any
} }
}; };
+40 -9
View File
@@ -1,7 +1,12 @@
import { Filter, Search } from "lucide-react-native"; import { Filter, Search } from "lucide-react-native";
import React from "react"; import React, { useEffect, useRef, useState } from "react";
import { View, Text, TextInput, StyleSheet, TouchableOpacity, Platform } from "react-native"; import { View, Text, TextInput, StyleSheet, TouchableOpacity, Platform } from "react-native";
import Animated, { useAnimatedStyle, useSharedValue, withTiming, interpolateColor } from "react-native-reanimated"; import Animated, {
useAnimatedStyle,
useSharedValue,
withTiming,
interpolateColor,
} from "react-native-reanimated";
import colors from "../../Constant/Color"; import colors from "../../Constant/Color";
export interface SearchType { export interface SearchType {
@@ -10,12 +15,22 @@ export interface SearchType {
label?: string; label?: string;
filter?: boolean; filter?: boolean;
filterPress?: () => void; filterPress?: () => void;
debounceDelay?: number; // 👈 optional
} }
const AnimatedView = Animated.createAnimatedComponent(View); const AnimatedView = Animated.createAnimatedComponent(View);
export const SearchInput: React.FC<SearchType> = ({ placeholder, onChange, label, filter = true, filterPress }) => { export const SearchInput: React.FC<SearchType> = ({
placeholder,
onChange,
label,
filter = true,
filterPress,
debounceDelay = 500, // 👈 default debounce
}) => {
const isFocused = useSharedValue(0); const isFocused = useSharedValue(0);
const [text, setText] = useState('');
const debounceRef = useRef<NodeJS.Timeout | null>(null);
const inputContainerStyle = useAnimatedStyle(() => { const inputContainerStyle = useAnimatedStyle(() => {
const borderColor = interpolateColor( const borderColor = interpolateColor(
@@ -25,13 +40,30 @@ export const SearchInput: React.FC<SearchType> = ({ placeholder, onChange, label
); );
return { return {
borderColor: borderColor, borderColor,
borderWidth: withTiming(isFocused.value ? 1.5 : 1), borderWidth: withTiming(isFocused.value ? 1.5 : 1),
transform: [{ scale: withTiming(isFocused.value ? 1.01 : 1) }], transform: [{ scale: withTiming(isFocused.value ? 1.01 : 1) }],
shadowOpacity: withTiming(isFocused.value ? 0.1 : 0), shadowOpacity: withTiming(isFocused.value ? 0.1 : 0),
}; };
}); });
// 🔥 Debounce logic
useEffect(() => {
if (debounceRef.current) {
clearTimeout(debounceRef.current);
}
debounceRef.current = setTimeout(() => {
onChange(text.trim());
}, debounceDelay);
return () => {
if (debounceRef.current) {
clearTimeout(debounceRef.current);
}
};
}, [text]);
return ( return (
<View style={styles.container}> <View style={styles.container}>
{label && <Text style={styles.label}>{label}</Text>} {label && <Text style={styles.label}>{label}</Text>}
@@ -40,13 +72,14 @@ export const SearchInput: React.FC<SearchType> = ({ placeholder, onChange, label
<AnimatedView style={[styles.inputWrapper, inputContainerStyle]}> <AnimatedView style={[styles.inputWrapper, inputContainerStyle]}>
<Search <Search
size={18} size={18}
color={isFocused.value ? colors.grayText : colors.grayText} color={colors.grayText}
style={styles.searchIcon} style={styles.searchIcon}
/> />
<TextInput <TextInput
style={styles.input} style={styles.input}
placeholder={placeholder} placeholder={placeholder}
onChangeText={onChange} value={text}
onChangeText={setText} // 👈 update local state only
placeholderTextColor={colors.grayText} placeholderTextColor={colors.grayText}
onFocus={() => (isFocused.value = withTiming(1))} onFocus={() => (isFocused.value = withTiming(1))}
onBlur={() => (isFocused.value = withTiming(0))} onBlur={() => (isFocused.value = withTiming(0))}
@@ -94,11 +127,9 @@ const styles = StyleSheet.create({
borderRadius: 12, borderRadius: 12,
paddingHorizontal: 12, paddingHorizontal: 12,
borderWidth: 1, borderWidth: 1,
// Shadow for iOS
shadowColor: "#000", shadowColor: "#000",
shadowOffset: { width: 0, height: 2 }, shadowOffset: { width: 0, height: 2 },
shadowRadius: 4, shadowRadius: 4,
// Elevation for Android
elevation: 2, elevation: 2,
}, },
searchIcon: { searchIcon: {
@@ -125,5 +156,5 @@ const styles = StyleSheet.create({
shadowOffset: { width: 0, height: 1 }, shadowOffset: { width: 0, height: 1 },
shadowOpacity: 0.1, shadowOpacity: 0.1,
shadowRadius: 2, shadowRadius: 2,
} },
}); });
-2
View File
@@ -1,12 +1,10 @@
import moment from 'moment'; import moment from 'moment';
export const format = { export const format = {
// Internal helper to safely parse any input
parse: (date: string | Date) => { parse: (date: string | Date) => {
if (!date) return null; if (!date) return null;
let d = date; let d = date;
if (typeof date === 'string') { if (typeof date === 'string') {
// Replace IST or other known timezone abbreviations with UTC offset
d = date.replace('IST', '+0530'); d = date.replace('IST', '+0530');
} }
return moment(d); return moment(d);
+4 -3
View File
@@ -18,13 +18,14 @@ const LiveAuction = () => {
const onEndReachedCalledDuringMomentum = useRef(true); const onEndReachedCalledDuringMomentum = useRef(true);
const SelectedPurchaseList = useSelector((state: any) => state.selectPurchaseAuction); const SelectedPurchaseList = useSelector((state: any) => state.selectPurchaseAuction);
const [showRefreshBanner, setShowRefreshBanner] = useState(false); const [showRefreshBanner, setShowRefreshBanner] = useState(false);
const [allBoolean, setAllBoolean] = useState({ liveAuctionData: [] }) const [allBoolean, setAllBoolean] = useState({ liveAuctionData: [], isLoading: false })
const { data, fetchNextPage, hasNextPage, isFetchingNextPage, isLoading, isRefetching, refetch, isPending }: any = useFetchLiveAuction(); const { data, fetchNextPage, hasNextPage, isFetchingNextPage, isLoading, isRefetching, refetch, isPending }: any = useFetchLiveAuction();
// My Methods // My Methods
const getMyAuction = async () => { const getMyAuction = async () => {
try { try {
setAllBoolean(prev => ({ ...prev, isLoading: true }))
const res = await apiCall<any>('get', `${GET_MY_AUCTION}`,); const res = await apiCall<any>('get', `${GET_MY_AUCTION}`,);
if (res?.statusCode === 200) { if (res?.statusCode === 200) {
const purchasedIds = new Set(res.data.map((item: any) => item.auctionId)); const purchasedIds = new Set(res.data.map((item: any) => item.auctionId));
@@ -100,7 +101,7 @@ const LiveAuction = () => {
return ( return (
<View style={{ flex: 1 }}> <View style={{ flex: 1 }}>
<SearchInput onChange={() => { }} placeholder="Search...." /> <SearchInput onChange={() => { }} placeholder="Search...." filter={false} />
{showRefreshBanner && ( {showRefreshBanner && (
<Animated.View <Animated.View
@@ -139,7 +140,7 @@ const LiveAuction = () => {
</Animated.View> </Animated.View>
)} )}
{ {
isPending ? <Skeleton /> : isPending || allBoolean.isLoading ? <Skeleton /> :
<FlatList <FlatList
data={allBoolean.liveAuctionData ?? []} data={allBoolean.liveAuctionData ?? []}
renderItem={renderItem} renderItem={renderItem}
@@ -72,7 +72,6 @@ const AuctionItemDetail: React.FC<Props> = ({ visible, onClose, data }) => {
}; };
return ( return (
<Modal <Modal
visible={visible} visible={visible}
transparent={false} transparent={false}
+36 -39
View File
@@ -1,30 +1,14 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { import { Modal, View, Text, StyleSheet, TouchableOpacity, Pressable } from 'react-native';
Modal,
View,
Text,
StyleSheet,
TouchableOpacity,
Pressable,
} from 'react-native';
import DatePicker from 'react-native-date-picker'; import DatePicker from 'react-native-date-picker';
import moment from 'moment'; import moment from 'moment';
import colors from '../../../Constant/Color'; import colors from '../../../Constant/Color';
import FontsFamily from '../../../Constant/FontsFamily'; import FontsFamily from '../../../Constant/FontsFamily';
import { AuctionStatus, Props } from '../types/types';
type AuctionStatus = 'RUNNING' | 'ENDED' | 'NOT_STARTED' | null;
interface Props {
visible: boolean;
onClose: () => void;
onApply: (filters: {
fromDate: Date | null;
toDate: Date | null;
status: AuctionStatus;
}) => void;
}
const FilterModal: React.FC<Props> = ({ visible, onClose, onApply }) => { const FilterModal: React.FC<Props> = ({ visible, onClose, setFilter, filter }) => {
const [fromDate, setFromDate] = useState<Date | null>(null); const [fromDate, setFromDate] = useState<Date | null>(null);
const [toDate, setToDate] = useState<Date | null>(null); const [toDate, setToDate] = useState<Date | null>(null);
const [status, setStatus] = useState<AuctionStatus>(null); const [status, setStatus] = useState<AuctionStatus>(null);
@@ -38,16 +22,26 @@ const FilterModal: React.FC<Props> = ({ visible, onClose, onApply }) => {
}; };
const handleConfirm = (date: Date) => { const handleConfirm = (date: Date) => {
if (pickerType === 'FROM') { if (pickerType === 'FROM') {
setFromDate(date); setFromDate(date);
console.log('FROM date set');
} else { } else {
setToDate(date); setToDate(date);
console.log('TO date set');
} }
setOpenPicker(false); setOpenPicker(false);
}; };
const handleApply = () => { const handleApply = () => {
onApply({ fromDate, toDate, status }); const payload = {
fromDate: fromDate ? fromDate.toISOString() : null,
toDate: toDate ? toDate.toISOString() : null,
status,
};
setFilter({ ...payload, auctionNumber: filter.auctionNumber || '' });
onClose(); onClose();
}; };
@@ -67,7 +61,7 @@ const FilterModal: React.FC<Props> = ({ visible, onClose, onApply }) => {
<View style={styles.container}> <View style={styles.container}>
<Text style={styles.title}>Filter Auctions</Text> <Text style={styles.title}>Filter Auctions</Text>
{/* ===== DATE RANGE ===== */} {/* DATE RANGE */}
<Text style={styles.sectionTitle}>Date Range</Text> <Text style={styles.sectionTitle}>Date Range</Text>
<View style={styles.dateRow}> <View style={styles.dateRow}>
@@ -96,7 +90,7 @@ const FilterModal: React.FC<Props> = ({ visible, onClose, onApply }) => {
</TouchableOpacity> </TouchableOpacity>
</View> </View>
{/* ===== STATUS ===== */} {/* STATUS */}
<Text style={styles.sectionTitle}>Auction Status</Text> <Text style={styles.sectionTitle}>Auction Status</Text>
<View style={styles.statusRow}> <View style={styles.statusRow}>
@@ -109,7 +103,9 @@ const FilterModal: React.FC<Props> = ({ visible, onClose, onApply }) => {
return ( return (
<TouchableOpacity <TouchableOpacity
key={item.value} key={item.value}
onPress={() => setStatus(item.value as AuctionStatus)} onPress={() =>
setStatus(item.value as AuctionStatus)
}
style={[ style={[
styles.statusPill, styles.statusPill,
active && styles.statusActive, active && styles.statusActive,
@@ -128,20 +124,25 @@ const FilterModal: React.FC<Props> = ({ visible, onClose, onApply }) => {
})} })}
</View> </View>
{/* ===== FOOTER ===== */} {/* FOOTER */}
<View style={styles.footer}> <View style={styles.footer}>
{/* <TouchableOpacity style={styles.cancelBtn} onPress={onClose}> <TouchableOpacity
<Text style={styles.cancelText}>Cancel</Text> style={[styles.applyBtn]}
</TouchableOpacity> */} onPress={() => { setFilter({}), onClose() }}
>
<TouchableOpacity style={styles.applyBtn} onPress={handleApply}> <Text style={styles.applyText}>Clear</Text>
</TouchableOpacity>
<TouchableOpacity
style={styles.applyBtn}
onPress={handleApply}
>
<Text style={styles.applyText}>Apply</Text> <Text style={styles.applyText}>Apply</Text>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
</View> </View>
</Modal> </Modal>
{/* ===== DATE PICKER ===== */} {/* DATE PICKER */}
<DatePicker <DatePicker
modal modal
open={openPicker} open={openPicker}
@@ -160,7 +161,6 @@ const FilterModal: React.FC<Props> = ({ visible, onClose, onApply }) => {
export default FilterModal; export default FilterModal;
const styles = StyleSheet.create({ const styles = StyleSheet.create({
overlay: { overlay: {
flex: 1, flex: 1,
@@ -229,31 +229,28 @@ const styles = StyleSheet.create({
statusText: { statusText: {
fontSize: 13, fontSize: 13,
color: '#334155', color: '#334155',
fontFamily:FontsFamily.poppinsSemiBold fontFamily: FontsFamily.poppinsSemiBold,
}, },
statusActiveText: { statusActiveText: {
color: '#fff', color: '#fff',
}, },
footer: { footer: {
marginTop: 24,
flexDirection: 'row', flexDirection: 'row',
justifyContent: 'space-between', justifyContent: 'space-between',
marginTop: 24, alignItems: 'center'
}, },
cancelBtn: {
padding: 12,
},
applyBtn: { applyBtn: {
backgroundColor: colors.primary, backgroundColor: colors.primary,
paddingHorizontal: 20, paddingHorizontal: 20,
paddingVertical: 12, paddingVertical: 12,
borderRadius: 12, borderRadius: 12,
width: '100%' width: '49%',
}, },
applyText: { applyText: {
color: '#fff', color: '#fff',
fontSize: 16, fontSize: 16,
textAlign: 'center', textAlign: 'center',
fontFamily: FontsFamily.poppinsSemiBold fontFamily: FontsFamily.poppinsSemiBold,
}, },
}); });
+6 -4
View File
@@ -19,7 +19,8 @@ const PurchaseAuction = () => {
const navigation = useNavigation() as any; const navigation = useNavigation() as any;
const Dispatch = useDispatch() const Dispatch = useDispatch()
const onEndReachedCalledDuringMomentum = useRef(true); const onEndReachedCalledDuringMomentum = useRef(true);
const { data, fetchNextPage, hasNextPage, isFetchingNextPage, isLoading, isRefetching, refetch, isPending }: any = useFetchLiveAuctionPage(); const [filter, setFilter] = useState({})
const { data, fetchNextPage, hasNextPage, isFetchingNextPage, isLoading, isRefetching, refetch, isPending }: any = useFetchLiveAuctionPage(filter);
const [allBoolean, setAllBoolean] = useState<allBooleanProps>({ isShowFilter: false }) const [allBoolean, setAllBoolean] = useState<allBooleanProps>({ isShowFilter: false })
const format = 'DD-MM-YYYY HH:mm:ss'; const format = 'DD-MM-YYYY HH:mm:ss';
@@ -60,9 +61,10 @@ const PurchaseAuction = () => {
); );
}, [isFetchingNextPage]); }, [isFetchingNextPage]);
return ( return (
<View style={{ flex: 1 }}> <View style={{ flex: 1 }}>
<SearchInput onChange={() => { }} placeholder='Search....' filterPress={() => { setAllBoolean((prev: any) => ({ ...prev, isShowFilter: !prev.isShowFilter })) }} /> <SearchInput onChange={(val) => { setFilter(prev => ({ ...prev, auctionNumber: val })) }} placeholder='Search....' filterPress={() => { setAllBoolean((prev: any) => ({ ...prev, isShowFilter: !prev.isShowFilter })) }} />
{isPending ? <Skelton /> {isPending ? <Skelton />
: :
<FlatList <FlatList
@@ -108,8 +110,8 @@ const PurchaseAuction = () => {
/> />
} }
{allBoolean.isShowFilter && <View style={{ flex: 1 }}> {allBoolean.isShowFilter && <View style={{ flex: 1 }}>
<FilterModal visible={allBoolean.isShowFilter} onClose={() => { setAllBoolean((prev: any) => ({ ...prev, isShowFilter: false })) }} onApply={() => { }} /> <FilterModal visible={allBoolean.isShowFilter} onClose={() => { setAllBoolean((prev: any) => ({ ...prev, isShowFilter: false })) }} setFilter={setFilter} filter={filter} />
</View>} </View>}.
</View> </View>
); );
+19
View File
@@ -15,4 +15,23 @@ export interface LiveAuctionTileProps {
export interface allBooleanProps { export interface allBooleanProps {
showDetail?: boolean showDetail?: boolean
isShowFilter?: boolean isShowFilter?: boolean
filterValue?: {
fromDate?: any,
toDate?: any,
status?: any
}
}
export type AuctionStatus = 'RUNNING' | 'ENDED' | 'NOT_STARTED' | null;
export interface Props {
visible: boolean;
onClose: () => void;
setFilter: (data: {
fromDate?: string | null;
toDate?: string | null;
status?: AuctionStatus;
auctionNumber?: any
}) => void;
filter: any
} }
@@ -18,7 +18,7 @@ const TemplateFormModal: React.FC<Props> = ({ visible, template, setAllBoolean }
const SelectedAuction = useSelector((state: any) => state.auction.auction) const SelectedAuction = useSelector((state: any) => state.auction.auction)
const Navigation: any = useNavigation() const Navigation: any = useNavigation()
const [loading, setLoading] = useState(false) const [loading, setLoading] = useState(false)
const initialValues = template.labels.reduce((acc: any, label: any) => { const initialValues = template?.labels?.reduce((acc: any, label: any) => {
acc[label.labelName] = '' acc[label.labelName] = ''
return acc return acc
}, {}) }, {})
@@ -150,7 +150,7 @@ const TemplateFormModal: React.FC<Props> = ({ visible, template, setAllBoolean }
([labelName, labelValue]: any) => { ([labelName, labelValue]: any) => {
if (typeof labelValue === 'object' && labelValue?.uri) { if (typeof labelValue === 'object' && labelValue?.uri) {
hasFile = true hasFile = true
fileFormData.append(labelName, { fileFormData.append('files', {
uri: labelValue.uri, uri: labelValue.uri,
name: labelValue.name, name: labelValue.name,
type: labelValue.type, type: labelValue.type,
@@ -166,14 +166,13 @@ const TemplateFormModal: React.FC<Props> = ({ visible, template, setAllBoolean }
const rs1: any = await apiCall('post', TECHNICAL_VALUE_SUBMIT, jsonBody) const rs1: any = await apiCall('post', TECHNICAL_VALUE_SUBMIT, jsonBody)
if (hasFile) { if (hasFile) {
fileFormData.append( fileFormData.append(
'auctiontId', 'auctionTemplateValueIds',
String(SelectedAuction.auctionId) String(rs1?.data[0]?.valueId)
) )
fileFormData.append( fileFormData.append(
'technicalDocumentTemplateId', 'templateNameId',
String(payload.templateNameId) String(payload.templateNameId)
) )
@@ -184,7 +183,7 @@ const TemplateFormModal: React.FC<Props> = ({ visible, template, setAllBoolean }
{}, {},
'multipart/form-data' 'multipart/form-data'
) )
console.log(res2, '-------------res2');
if (rs1.statusCode == 200 && res2.statusCode == 200) { if (rs1.statusCode == 200 && res2.statusCode == 200) {
Navigation.navigate(NavigationString.StartBidding) Navigation.navigate(NavigationString.StartBidding)
setAllBoolean((prev: any) => ({ ...prev, technicalDocModalVisible: false })) setAllBoolean((prev: any) => ({ ...prev, technicalDocModalVisible: false }))
@@ -397,7 +396,7 @@ const styles = StyleSheet.create({
submitRow: { submitRow: {
marginTop: 20, marginTop: 20,
alignItems: 'flex-end', alignItems: 'flex-end',
height:50 height: 50
}, },
submitBtn: { submitBtn: {
backgroundColor: colors.primary, backgroundColor: colors.primary,
-3
View File
@@ -15,7 +15,6 @@ import { AUCITON_SINGLE_EMD, AUCTION_ITEM_SUBMIT, CHECK_TECHNICAL_DOCUMENTAION,
import TemplateFormModal from './Component/TemplateFormModal'; import TemplateFormModal from './Component/TemplateFormModal';
import { SelectedItem } from './Type/BidType'; import { SelectedItem } from './Type/BidType';
import FontsFamily from '../../Constant/FontsFamily'; import FontsFamily from '../../Constant/FontsFamily';
import { all } from 'axios';
import { showSuccessAlert } from '../../Constant/ShowDailog'; import { showSuccessAlert } from '../../Constant/ShowDailog';
@@ -231,7 +230,6 @@ const Emd = () => {
mutate({ auctionNumber: SelectedAuction.auctionNumber }, { mutate({ auctionNumber: SelectedAuction.auctionNumber }, {
onSuccess: (async (res) => { onSuccess: (async (res) => {
if (res.statusCode == 200) { if (res.statusCode == 200) {
if (res.message == 'No EMD Documents') { if (res.message == 'No EMD Documents') {
const result = await getAuction() const result = await getAuction()
if (result) { if (result) {
@@ -381,7 +379,6 @@ const Emd = () => {
}; };
useEffect(() => { useEffect(() => {
// getAuction()
AlreadyEmdCheck() AlreadyEmdCheck()
}, []) }, [])
+1
View File
@@ -5,6 +5,7 @@ import { Layers, Clock, ShoppingCart, X, FileText } from 'lucide-react-native';
import { Header } from '../../Component/Index'; import { Header } from '../../Component/Index';
import colors from '../../Constant/Color'; import colors from '../../Constant/Color';
import { useDashboard } from '../../Services/BBPS/Hooks'; import { useDashboard } from '../../Services/BBPS/Hooks';
import { log } from 'console';
const { width } = Dimensions.get('window'); const { width } = Dimensions.get('window');
const CARD_WIDTH = (width - 48) / 2; const CARD_WIDTH = (width - 48) / 2;
+1 -1
View File
@@ -66,7 +66,7 @@ const DASHBOARD_COUNT = `${BASE_URL_Auction}api/auction/home/dashboard/counts`
const AUCTION_ONE_TIME_BID = `${BASE_URL_Auction}api/bidding/getBidForAuction` const AUCTION_ONE_TIME_BID = `${BASE_URL_Auction}api/bidding/getBidForAuction`
const AUCITON_SINGLE_EMD = `${BASE_URL_Auction}api/auction/addEMDDocumentsAuctionWise` const AUCITON_SINGLE_EMD = `${BASE_URL_Auction}api/auction/addEMDDocumentsAuctionWise`
const PURCHASE_AUCTION_LIST = `${BASE_URL_Auction}api/auction/proceedToPurchase` const PURCHASE_AUCTION_LIST = `${BASE_URL_Auction}api/auction/proceedToPurchase`
const VIEW_AUCTION_ITEM_DETAIL = `${BASE_URL_Auction}api/auction/home/viewDocumentsForAuctionItemDetails` const VIEW_AUCTION_ITEM_DETAIL = `${BASE_URL_Auction}api/auction/viewDocumentsForAuctionItemDetails`
const VIEW_AUCTION_DOCUMENTS = `${BASE_URL_Auction}api/auction/viewDocumentsForAuction` const VIEW_AUCTION_DOCUMENTS = `${BASE_URL_Auction}api/auction/viewDocumentsForAuction`
const AUCTION_DOCUMENT_DOWNLOAD = `${BASE_URL_Auction}api/auction/home/downloadDocumentForAuction` const AUCTION_DOCUMENT_DOWNLOAD = `${BASE_URL_Auction}api/auction/home/downloadDocumentForAuction`
const AUCTION_ITEM_DOCUMENT_DOWNLOAD = `${BASE_URL_Auction}api/auction/home/downloadDocument/auctionItemId` const AUCTION_ITEM_DOCUMENT_DOWNLOAD = `${BASE_URL_Auction}api/auction/home/downloadDocument/auctionItemId`
+11 -10
View File
@@ -66,13 +66,14 @@ export const useFetchPurchaseAuction = () => {
}); });
}; };
export const useFetchLiveAuctionPage = () => { export const useFetchLiveAuctionPage = (payload: any) => {
return useInfiniteQuery<any>({ return useInfiniteQuery<any>({
queryKey: ['fetchPurchaseAuctionPage'], queryKey: ['fetchPurchaseAuctionPage', payload],
queryFn: ({ pageParam = 0 }) => queryFn: ({ pageParam = 0 }) =>
fetchPurchaseAuctionPage({ fetchPurchaseAuctionPage({
page: pageParam, page: pageParam,
size: 10, size: 10,
...payload
}), }),
initialPageParam: 0, initialPageParam: 0,
@@ -198,7 +199,7 @@ export const usefetchMasterData = () => {
}); });
} }
export const useCityDropdown = () => { export const useCityDropdown = () => {
return useMutation({ return useMutation({
mutationFn: (stateId: number) => fetchCityDropdown(stateId), mutationFn: (stateId: number) => fetchCityDropdown(stateId),
}); });
@@ -210,33 +211,33 @@ export const useVerifyPan = () =>
}); });
export const useSendAadhaarOtp = () => export const useSendAadhaarOtp = () =>
useMutation({ useMutation({
mutationFn: sendAadhaarOtp, mutationFn: sendAadhaarOtp,
}); });
export const useVerifyAadhaarOtp = () => export const useVerifyAadhaarOtp = () =>
useMutation({ useMutation({
mutationFn: verifyAadhaarOtp, mutationFn: verifyAadhaarOtp,
}); });
export const useVerifyGstNumber = () => export const useVerifyGstNumber = () =>
useMutation({ useMutation({
mutationFn: verifyGstNumber, mutationFn: verifyGstNumber,
}); });
export const useContractorStageTwoSubmit = () => export const useContractorStageTwoSubmit = () =>
useMutation({ useMutation({
mutationFn: contractorStageTwoSubmit, mutationFn: contractorStageTwoSubmit,
}); });
export const useContractorStageThreeSubmit = () => export const useContractorStageThreeSubmit = () =>
useMutation({ useMutation({
mutationFn: contractorStageThreeSubmit, mutationFn: contractorStageThreeSubmit,
}); });
export const usePartnerShipSubmit = () => export const usePartnerShipSubmit = () =>
useMutation({ useMutation({
mutationFn: partnerShipSubmit, mutationFn: partnerShipSubmit,
}); });
@@ -285,7 +286,7 @@ export const useGetAucitonDocument = (payload: { auctionId: number }) => {
export const useAucitonItemDetail = (payload: { auctionItemId: number }) => { export const useAucitonItemDetail = (payload: { auctionItemId: number }) => {
return useQuery({ return useQuery({
queryKey: ['viewAuctionItemDocuments'], queryKey: [],
queryFn: () => viewAuctionItemDocuments(payload) queryFn: () => viewAuctionItemDocuments(payload)
}); });
}; };
+2
View File
@@ -51,6 +51,8 @@ export const fetchPurchaseAuction = async (): Promise<any> => {
return data return data
} }
export const fetchPurchaseAuctionPage = async (payload: any): Promise<any> => { export const fetchPurchaseAuctionPage = async (payload: any): Promise<any> => {
console.log(payload,'[[[[[[[[[[[[[[[[[[[[[[[[');
const data = await apiCall<any>('get', `${PURCHASE_AUCTION_PAGE}`, {}, payload); const data = await apiCall<any>('get', `${PURCHASE_AUCTION_PAGE}`, {}, payload);
return data return data
} }
View File