mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-04 11:48:05 +00:00
Add a little sort and active filter.
This commit is contained in:
@@ -58,6 +58,7 @@ class BillController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Documentation for this endpoint is at:
|
* Documentation for this endpoint is at:
|
||||||
* https://api-docs.firefly-iii.org/#/autocomplete/getBillsAC
|
* https://api-docs.firefly-iii.org/#/autocomplete/getBillsAC
|
||||||
|
* TODO expand API to add active field.
|
||||||
*
|
*
|
||||||
* @param AutocompleteRequest $request
|
* @param AutocompleteRequest $request
|
||||||
*
|
*
|
||||||
@@ -72,6 +73,7 @@ class BillController extends Controller
|
|||||||
return [
|
return [
|
||||||
'id' => (string) $item->id,
|
'id' => (string) $item->id,
|
||||||
'name' => $item->name,
|
'name' => $item->name,
|
||||||
|
'active' => $item->active
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
2
public/v1/js/create_transaction.js
vendored
2
public/v1/js/create_transaction.js
vendored
File diff suppressed because one or more lines are too long
2
public/v1/js/edit_transaction.js
vendored
2
public/v1/js/edit_transaction.js
vendored
File diff suppressed because one or more lines are too long
@@ -98,9 +98,17 @@ export default {
|
|||||||
];
|
];
|
||||||
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.bills.push(res.data[key]);
|
let current = res.data[key];
|
||||||
|
if(current.active) {
|
||||||
|
this.bills.push(res.data[key]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.bills.sort(function(a, b) {
|
||||||
|
if (a.name < b.name) return -1;
|
||||||
|
if (a.name > b.name) return 1;
|
||||||
|
return 0;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user