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
+10
-6
No files matched your search
@@ -1,7 +1,6 @@
|
|||||||
function convert(from) {
|
async function convert(from) {
|
||||||
fetch(`https://api.frankfurter.dev/v1/latest?base=${from}`)
|
const res = await fetch(`https://api.frankfurter.dev/v1/latest?base=${from}`);
|
||||||
.then((resp) => resp.json())
|
const data = await res.json();
|
||||||
.then((data) => {
|
|
||||||
console.log(data);
|
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