Private
Public Access
1
0

fix: add HealthCheckListResponse type to match API response structure
Some checks failed
CI Pipeline / Rust Format Check (push) Successful in 6s
CI Pipeline / Clippy Lints (push) Successful in 46s
CI Pipeline / Rust Unit Tests (push) Successful in 1m1s
CI Pipeline / Security Audit (push) Successful in 4s
CI Pipeline / Frontend Lint & Type Check (push) Failing after 10s
CI Pipeline / Build .deb & Release (push) Has been skipped

- Added HealthCheckListResponse type { checks: [...], total: number }
- Updated healthChecksApi.list() return type to HealthCheckListResponse
- Fixed HostDetailPage to use res.data?.checks instead of Array.isArray
- Added Target column to health checks table
- Added git pre-commit/pre-push hooks to prevent format CI failures
- Updated lessons.md
This commit is contained in:
2026-05-06 16:18:29 +00:00
parent 12d640e5de
commit 0e9cb1c915
6 changed files with 119 additions and 1 deletions

View File

@ -11,6 +11,7 @@ import type {
HealthCheckWithResult,
CreateHealthCheckRequest,
UpdateHealthCheckRequest,
HealthCheckListResponse,
} from '../types'
const BASE_URL = '/api/v1'
@ -273,7 +274,7 @@ export const settingsApi = {
export const healthChecksApi = {
list: (hostId: string) =>
apiClient.get<HealthCheckWithResult[]>(`/hosts/${hostId}/health-checks`),
apiClient.get<HealthCheckListResponse>(`/hosts/${hostId}/health-checks`),
get: (hostId: string, checkId: string) =>
apiClient.get<HealthCheckWithResult>(`/hosts/${hostId}/health-checks/${checkId}`),

View File

@ -299,6 +299,11 @@ export interface HealthCheckWithResult extends HealthCheck {
last_result?: HealthCheckResult
}
export interface HealthCheckListResponse {
checks: HealthCheckWithResult[]
total: number
}
export interface CreateHealthCheckRequest {
name: string
check_type: HealthCheckType