Add AbortController cleanup to async frontend effects

This commit is contained in:
2026-04-18 21:30:57 +02:00
parent 2105f8b435
commit 6c053cdaee
16 changed files with 128 additions and 37 deletions

View File

@@ -43,6 +43,7 @@ export async function fetchBans(
pageSize = 100,
origin: BanOriginFilter = "all",
source: "fail2ban" | "archive" = "fail2ban",
signal?: AbortSignal,
): Promise<DashboardBanListResponse> {
const params = new URLSearchParams({
range,
@@ -55,7 +56,7 @@ export async function fetchBans(
if (source !== "fail2ban") {
params.set("source", source);
}
return get<DashboardBanListResponse>(`${ENDPOINTS.dashboardBans}?${params.toString()}`);
return get<DashboardBanListResponse>(`${ENDPOINTS.dashboardBans}?${params.toString()}`, signal);
}
/**