summaryrefslogtreecommitdiff
path: root/gui/src/ajax
diff options
context:
space:
mode:
authorJoe Carstairs <me@joeac.net>2024-10-22 07:46:43 +0100
committerJoe Carstairs <me@joeac.net>2024-10-22 07:46:43 +0100
commit5824c353f978a5b9ab9696451ee3014c6a614ffc (patch)
treebc39754ca417e84eb00b0aa9a1ae2330da0bf282 /gui/src/ajax
parent7adaace61a4fe983eba5ded3aaaf624ce6fb9014 (diff)
Refactors importer to use core stuff
Diffstat (limited to 'gui/src/ajax')
-rw-r--r--gui/src/ajax/backend.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/gui/src/ajax/backend.ts b/gui/src/ajax/backend.ts
index 90a7ea5..4a2462f 100644
--- a/gui/src/ajax/backend.ts
+++ b/gui/src/ajax/backend.ts
@@ -1,5 +1,6 @@
import { BalanceMap, newCategoryBalanceMapFromDto } from "../types/balanceMap";
import { BudgetMap, newBudgetMapFromDto } from "../types/budgetMap";
+import { BudgetUpdate, newBudgetUpdateFromDto } from "../types/budgetUpdate";
import { Category, newCategoryFromDto } from "../types/category";
const backendUrl = "http://localhost:8000";
@@ -23,6 +24,13 @@ function makeGetter<T>(params: FetcherMakerParams<T>): Getter<T> {
};
}
+export const getAllBudgetUpdates: Getter<BudgetUpdate[]> = makeGetter<
+ BudgetUpdate[]
+>({
+ path: "/budget-update",
+ elementParser: newBudgetUpdateFromDto,
+});
+
export const getAllCategories: Getter<Category[]> = async () => {
const balances = await getAllCategoryBalances();
const budgets = await getAllCurrentCategoryBudgets();