Refactor frontend API calls into hooks and complete task states

This commit is contained in:
2026-03-20 15:18:04 +01:00
parent d30d138146
commit 28a7610276
16 changed files with 483 additions and 409 deletions

View File

@@ -41,6 +41,21 @@ const {
// Mock the jail detail hook — tests control the returned state directly.
vi.mock("../../hooks/useJails", () => ({
useJailDetail: vi.fn(),
useJailBannedIps: vi.fn(() => ({
items: [],
total: 0,
page: 1,
pageSize: 25,
search: "",
loading: false,
error: null,
opError: null,
refresh: vi.fn(),
setPage: vi.fn(),
setPageSize: vi.fn(),
setSearch: vi.fn(),
unban: vi.fn(),
})),
}));
// Mock API functions used by JailInfoSection control buttons to avoid side effects.