mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-02 03:51:18 +00:00
This commit is contained in:
@@ -176,9 +176,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
loadCurrencies: function () {
|
loadCurrencies: function () {
|
||||||
//console.log('loadCurrencies');
|
// reset list of currencies:
|
||||||
let URI = document.getElementsByTagName('base')[0].href + "api/v1/currencies";
|
|
||||||
axios.get(URI, {}).then((res) => {
|
|
||||||
this.currencies = [
|
this.currencies = [
|
||||||
{
|
{
|
||||||
id: 0,
|
id: 0,
|
||||||
@@ -198,6 +196,14 @@ export default {
|
|||||||
id: 0,
|
id: 0,
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
this.getCurrencies(1);
|
||||||
|
},
|
||||||
|
getCurrencies: function(page) {
|
||||||
|
console.log('loadCurrencies on page ' + page);
|
||||||
|
let url = document.getElementsByTagName('base')[0].href + "api/v1/currencies?page=" + page;
|
||||||
|
axios.get(url, {}).then((res) => {
|
||||||
|
|
||||||
for (const key in res.data.data) {
|
for (const key in res.data.data) {
|
||||||
if (res.data.data.hasOwnProperty(key) && /^0$|^[1-9]\d*$/.test(key) && key <= 4294967294) {
|
if (res.data.data.hasOwnProperty(key) && /^0$|^[1-9]\d*$/.test(key) && key <= 4294967294) {
|
||||||
if (res.data.data[key].attributes.enabled) {
|
if (res.data.data[key].attributes.enabled) {
|
||||||
@@ -207,7 +213,9 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// console.log(this.enabledCurrencies);
|
if(res.data.meta.pagination.current_page < res.data.meta.pagination.total_pages) {
|
||||||
|
this.getCurrencies(res.data.meta.pagination.current_page + 1);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user