feat: update currency index
This commit is contained in:
@@ -38,7 +38,7 @@ export default async (req, res) => {
|
|||||||
|
|
||||||
const send_call = fetch("https://api.taptapsend.com/api/fxRates", requestOptions)
|
const send_call = fetch("https://api.taptapsend.com/api/fxRates", requestOptions)
|
||||||
.then((response) => response.json())
|
.then((response) => response.json())
|
||||||
.then((result) => rates.send = result.availableCountries[1].corridors[27]["fxRate"])
|
.then((result) => rates.send = result.availableCountries[1].corridors[29]["fxRate"])
|
||||||
.catch((error) => console.log("error", error));
|
.catch((error) => console.log("error", error));
|
||||||
|
|
||||||
var myHeaders = new Headers();
|
var myHeaders = new Headers();
|
||||||
@@ -68,13 +68,13 @@ export default async (req, res) => {
|
|||||||
|
|
||||||
|
|
||||||
await Promise.all([send_call, tap_call])
|
await Promise.all([send_call, tap_call])
|
||||||
.then(([tap_response, send_response]) => {
|
.then(([tap_response, send_response]) => {
|
||||||
rates.send = send_response.toString();
|
rates.send = send_response.toString();
|
||||||
rates.tap = tap_response.toString();
|
rates.tap = tap_response.toString();
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
});
|
});
|
||||||
|
|
||||||
return res.status(200).json(rates);
|
return res.status(200).json(rates);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user