mirror of
https://github.com/Zproger/Aurum.git
synced 2026-10-17 04:56:40 +07:00
feat: add year switcher to Dashboard, Transactions and Budget
Year was previously hardcoded to the current year on all three pages (useState with no setter) — only the month could be changed via MonthSelector, making it impossible to look at or compare older years even though transaction history goes back further than the current year. Adds GET /transactions/years (contiguous range from the earliest transaction through the current year) and a YearSelector component matching MonthSelector's style, wired into all three pages alongside a real year useState.
This commit is contained in:
@@ -24,6 +24,13 @@ export function fetchTransactions(filters: TransactionFilters = {}) {
|
||||
return api.get<TransactionPage>(`/transactions?${params.toString()}`);
|
||||
}
|
||||
|
||||
/** Full range of years to offer in the year picker, from the earliest
|
||||
* transaction through the current year (see backend for the "gap year"
|
||||
* rationale). */
|
||||
export function fetchTransactionYears() {
|
||||
return api.get<number[]>("/transactions/years");
|
||||
}
|
||||
|
||||
export function createTransaction(input: TransactionInput) {
|
||||
return api.post<Transaction>("/transactions", input);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user