feat: add category management page (create/edit/delete)

The backend already had full category CRUD but nothing in the UI exposed
it — categories could only be viewed inside charts. Adds a Categories nav
item and page with icon/color pickers, grouped by expense/income, backed
by new create/update/delete mutations. Also expands icons.tsx's ICON_MAP,
which was missing 14 icon keys already in use by real category data and
silently falling back to a wallet glyph everywhere they render.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
ZProger
2026-08-24 23:43:06 +03:00
parent 6cc532378b
commit 9f5ea00227
13 changed files with 512 additions and 5 deletions

View File

@@ -1,6 +1,18 @@
import { api } from "@/api/client";
import type { Category } from "@/types";
import type { Category, CategoryInput, CategoryUpdateInput } from "@/types";
export function fetchCategories() {
return api.get<Category[]>("/categories");
}
export function createCategory(input: CategoryInput) {
return api.post<Category>("/categories", input);
}
export function updateCategory(id: number, input: CategoryUpdateInput) {
return api.patch<Category>(`/categories/${id}`, input);
}
export function deleteCategory(id: number) {
return api.delete<void>(`/categories/${id}`);
}