Loan details updates
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
@@ -9,6 +9,7 @@ import {getLoans} from '../../services/siteServices'
|
|||||||
import getDateFromDateString from '../../helpers/GetDateFromDateString';
|
import getDateFromDateString from '../../helpers/GetDateFromDateString';
|
||||||
import formatNumber from '../../helpers/formatNumber'
|
import formatNumber from '../../helpers/formatNumber'
|
||||||
import getTimeFromDateString from "../../helpers/GetTimeFromDateString";
|
import getTimeFromDateString from "../../helpers/GetTimeFromDateString";
|
||||||
|
import { initiateDisburseRetrials } from "../../services/siteEventService"
|
||||||
|
|
||||||
export default function LoanDetails({transactionID}) {
|
export default function LoanDetails({transactionID}) {
|
||||||
|
|
||||||
@@ -21,8 +22,12 @@ export default function LoanDetails({transactionID}) {
|
|||||||
// const loansCount = allLoans?.data?.count // LOANS LIST COUNT
|
// const loansCount = allLoans?.data?.count // LOANS LIST COUNT
|
||||||
|
|
||||||
const handleClick = (transactioID) => {
|
const handleClick = (transactioID) => {
|
||||||
alert(transactioID)
|
// alert(transactioID)
|
||||||
console.log('Button clicked!');
|
const fields={
|
||||||
|
"transactionId": transactioID
|
||||||
|
}
|
||||||
|
return initiateDisburseRetrials(fields)
|
||||||
|
// console.log('Button clicked!');
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
import axios from "axios"
|
||||||
|
|
||||||
|
//REACT_APP_EVENT_API='https://event-core.simbrellang.net'
|
||||||
|
axios.interceptors.request.use(
|
||||||
|
config => {
|
||||||
|
config.headers = {
|
||||||
|
Accept: "application/json",
|
||||||
|
"Access-Control-Allow-Origin": "*",
|
||||||
|
};
|
||||||
|
return config;
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
return Promise.reject(error);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
const postAuxEnd = (path, postData, media=false) => {
|
||||||
|
const basePath = media ? process.env.REACT_APP_EVENT_API : 'https://event-core.simbrellang.net'
|
||||||
|
// const basePath = media ? 'http://209.195.2.27:5000' : 'http://209.195.2.27:5000'
|
||||||
|
//10.10.11.17
|
||||||
|
// const basePath = media ? 'http://10.10.11.17:5000' : 'http://10.10.11.17:5000'
|
||||||
|
return axios.post(`${basePath}${path}`, postData).then(res => {
|
||||||
|
return res
|
||||||
|
}).catch(err => {
|
||||||
|
// throw new Error(err.response.data.message);
|
||||||
|
throw new Error(err);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const getAuxEnd = (path, reqData= null) => {
|
||||||
|
const basePath = 'https://event-core.simbrellang.net'
|
||||||
|
//const basePath = 'http://209.195.2.27:5000'
|
||||||
|
return axios.get(`${basePath}${path}`,{ params: reqData }).then(res => {
|
||||||
|
return res
|
||||||
|
// localStorage.clear();
|
||||||
|
// window.location.href = `/login?sessionExpired=true`;
|
||||||
|
}).catch(err => {
|
||||||
|
throw new Error(err);
|
||||||
|
// throw new Error(err.response.data.message);
|
||||||
|
// return err
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO GET SALARY RECEIVED
|
||||||
|
export const initiateDisburseRetrials = (reqData) => {
|
||||||
|
let postData = {
|
||||||
|
...reqData
|
||||||
|
}
|
||||||
|
return postAuxEnd('/autocall/retry-disbursement', postData, false)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user