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
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:
@ -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}`),
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user