2
0
mirror of https://github.com/frappe/books.git synced 2024-09-20 11:29:00 +00:00

Change VATComply API for exchange rates

Change the exchangeratesapi.io to https://api.vatcomply.com rates API.

I'm the original author of Exchangerates API which now has a paywall and was acquired some years ago.

VATComply API will not be sold and provides the same API for exchange rates for free without requiring a API key.
This commit is contained in:
Madis Väin 2021-11-09 18:47:55 +02:00 committed by GitHub
parent 3afdb72ed3
commit d0c6c27cf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,7 +14,7 @@ export async function getExchangeRate({ fromCurrency, toCurrency, date }) {
if (!exchangeRate) { if (!exchangeRate) {
try { try {
let res = await fetch( let res = await fetch(
`https://api.exchangeratesapi.io/${date}?base=${fromCurrency}&symbols=${toCurrency}` `https://api.vatcomply.com/${date}?base=${fromCurrency}&symbols=${toCurrency}`
); );
let data = await res.json(); let data = await res.json();
exchangeRate = data.rates[toCurrency]; exchangeRate = data.rates[toCurrency];