This commit is contained in:
James Cole
2020-02-14 08:43:57 +01:00
parent ccc80dd437
commit 39cdbc461e

View File

@@ -61,16 +61,12 @@
loadBudgets: function () { loadBudgets: function () {
let URI = document.getElementsByTagName('base')[0].href + "json/budgets"; let URI = document.getElementsByTagName('base')[0].href + "json/budgets";
axios.get(URI, {}).then((res) => { axios.get(URI, {}).then((res) => {
this.budgets = [ this.budgets = [
{ {
name: this.no_budget, name: this.no_budget,
id: 0, id: 0,
}, }
{ ];
name: this.no_budget,
id: null,
}
];
for (const key in res.data) { for (const key in res.data) {
if (res.data.hasOwnProperty(key) && /^0$|^[1-9]\d*$/.test(key) && key <= 4294967294) { if (res.data.hasOwnProperty(key) && /^0$|^[1-9]\d*$/.test(key) && key <= 4294967294) {
this.budgets.push(res.data[key]); this.budgets.push(res.data[key]);