Merge branch 'feature/challenge1' of https://github.com/JoaquinPar/2800-202510-BBY14 into feature/challenge1
This commit is contained in:
commit
93a5c45dd9
2 files changed
+11
-7
No files matched your search
@@ -1,7 +1,6 @@
|
||||
function convert(from) {
|
||||
fetch(`https://api.frankfurter.dev/v1/latest?base=${from}`)
|
||||
.then((resp) => resp.json())
|
||||
.then((data) => {
|
||||
console.log(data);
|
||||
});
|
||||
async function convert(from) {
|
||||
const res = await fetch(`https://api.frankfurter.dev/v1/latest?base=${from}`);
|
||||
const data = await res.json();
|
||||
|
||||
return data;
|
||||
}
|
||||
@@ -1 +1,6 @@
|
||||
|
||||
const { getCollection } = require('./src/database/connection');
|
||||
|
||||
async function saveExchangeRates() {
|
||||
const { currencies } = getCollection();
|
||||
await currencies.insertMany(convert());
|
||||
}
|
||||
Reference in new issue
Block a user