Merge branch 'etender' of https://git.zeptic.in/rohit/Procurelinc into etenderMerge
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useInfiniteQuery, useMutation, useQuery } from '@tanstack/react-query';
|
||||
import { contractorStageThreeSubmit, contractorStageTwoSubmit, fetchAuctionItem, fetchCityDropdown, fetchDashboard, fetchEmdCheck, fetchLiveAuction, fetchLiveTender, fetchMasterData, fetchPurchaseAuction, fetchPurchaseTender, fetchTenderById, getDesignation, getRagistrationState, offlineAuctionPurchase, offlineTenderPurchase, partnerShipSubmit, proceedToBid, registerContractor, sendAadhaarOtp, userAuctionLogin, userLogin, verifyAadhaarOtp, verifyGstNumber, verifyPanHandler } from './apis';
|
||||
import { fetchAuctionItem, fetchCityDropdown, fetchDashboard, fetchEmdCheck, fetchLiveAuction, fetchLiveTender, fetchMasterData, fetchPurchaseAuction, fetchPurchaseTender, fetchTenderById, getDesignation, getRagistrationState, offlineAuctionPurchase, offlineTenderPurchase, proceedToBid, registerContractor, sendAadhaarOtp, userAuctionLogin, userLogin, verifyAadhaarOtp, verifyGstNumber, verifyPanHandler } from './apis';
|
||||
import { apiCall } from '../../Axios/Axios';
|
||||
|
||||
// User
|
||||
@@ -171,9 +171,9 @@ export const usefetchMasterData = () => {
|
||||
});
|
||||
}
|
||||
|
||||
export const useCityDropdown = () => {
|
||||
export const useCityDropdown = (stateId?: number) => {
|
||||
return useMutation({
|
||||
mutationFn: (stateId: number) => fetchCityDropdown(stateId),
|
||||
mutationFn: () => fetchCityDropdown(stateId as number),
|
||||
});
|
||||
};
|
||||
|
||||
@@ -196,20 +196,4 @@ export const useVerifyPan = () =>
|
||||
export const useVerifyGstNumber = () =>
|
||||
useMutation({
|
||||
mutationFn: verifyGstNumber,
|
||||
});
|
||||
|
||||
|
||||
export const useContractorStageTwoSubmit = () =>
|
||||
useMutation({
|
||||
mutationFn: contractorStageTwoSubmit,
|
||||
});
|
||||
|
||||
export const useContractorStageThreeSubmit = () =>
|
||||
useMutation({
|
||||
mutationFn: contractorStageThreeSubmit,
|
||||
});
|
||||
|
||||
export const usePartnerShipSubmit = () =>
|
||||
useMutation({
|
||||
mutationFn: partnerShipSubmit,
|
||||
});
|
||||
@@ -1,9 +1,17 @@
|
||||
import axios from "axios";
|
||||
import { ALL_DESIGNATION, DASHBOARD_COUNT, EMD_CHECK, FORARD_AUCTION_ITEM, GET_MASTER_DATA, GET_MY_AUCTION, GET_MY_TENDER, GET_REGISTRATION_STATE, GET_TENDER_DETAILS, GETCONTRACTORBYSTATE, LIVE_AUCTION, LIVE_TENDER, LOG_IN_URL, PARTNER_API_ENDPOINT, PROCEED_PURCHASE_AUCTION, PROCEED_TO_BID, PURCHASE_OFFLINE_AUCTION, PURCHASE_TENDER_OFFLINE, REJ_STAGE_TWO, REVERSE_AUCTION_ITEM, SAVE_CONTRACTOR_STAGE1, SEND_ADHAROTP, STAGETHREE, TENDER_LOGIN, VERIFY_ADHAR, VERIFY_GST,VERIFY_ORGPAN } from "./ApiUrls";
|
||||
import { ALL_DESIGNATION, DASHBOARD_COUNT, EMD_CHECK, FORARD_AUCTION_ITEM, GET_MASTER_DATA, GET_MY_AUCTION, GET_MY_TENDER, GET_REGISTRATION_STATE, GET_TENDER_DETAILS, GETCONTRACTORBYSTATE, LIVE_AUCTION, LIVE_TENDER, LOG_IN_URL, PARTNER_API_ENDPOINT, PROCEED_PURCHASE_AUCTION, PROCEED_TO_BID, PURCHASE_OFFLINE_AUCTION, PURCHASE_TENDER_OFFLINE, SUBMIT_ENVELOPE_A, SUBMIT_ENVELOPE_B, SUBMIT_ENVELOPE_FILE_A, SUBMIT_ENVELOPE_FILE_B, REJ_STAGE_TWO, REVERSE_AUCTION_ITEM, SAVE_CONTRACTOR_STAGE1, SEND_ADHAROTP, STAGETHREE, TENDER_LOGIN, VERIFY_ADHAR, VERIFY_GST,VERIFY_ORGPAN } from "./ApiUrls";
|
||||
import { apiCall } from "../../Axios/Axios";
|
||||
|
||||
// User
|
||||
|
||||
export type UploadArgs = {
|
||||
activeEnvelope: 'A' | 'B'
|
||||
file: {
|
||||
uri: string
|
||||
name: string
|
||||
type: string
|
||||
}
|
||||
payload: any
|
||||
}
|
||||
type DropdownOption = { label: string; value: number | string };
|
||||
|
||||
type State = { stateId: number; stateName: string };
|
||||
@@ -271,3 +279,44 @@ export const partnerShipSubmit = (
|
||||
payload,
|
||||
);
|
||||
};
|
||||
|
||||
export const submitEnvelopeA = async (payload: any) => {
|
||||
console.log('SUBMIT ENVELOPE A API CALLED', payload)
|
||||
const { data } = await apiCall<any>('post', SUBMIT_ENVELOPE_A, payload)
|
||||
console.log("data : ", data)
|
||||
return data
|
||||
}
|
||||
export const submitEnvelopeB = async (payload: any) => {
|
||||
console.log('SUBMIT ENVELOPE B API CALLED', payload)
|
||||
const { data } = await apiCall<any>('post', SUBMIT_ENVELOPE_B, payload)
|
||||
console.log("data : ", data)
|
||||
return data
|
||||
}
|
||||
|
||||
|
||||
export const uploadEnvelopeFile = async ({
|
||||
activeEnvelope,
|
||||
file,
|
||||
payload,
|
||||
}: UploadArgs) => {
|
||||
const formData = new FormData()
|
||||
|
||||
formData.append('files', {
|
||||
uri: file.uri,
|
||||
name: file.name,
|
||||
type: file.type,
|
||||
} as any)
|
||||
|
||||
formData.append('requestDto', JSON.stringify(payload))
|
||||
|
||||
const url =
|
||||
activeEnvelope === 'B' ? SUBMIT_ENVELOPE_FILE_B : SUBMIT_ENVELOPE_FILE_A
|
||||
|
||||
const data = await apiCall('post', url, formData, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
})
|
||||
|
||||
return data
|
||||
}
|
||||
Reference in New Issue
Block a user