fix: TypeScript strict mode errors in server and services
This commit is contained in:
@@ -64,7 +64,7 @@ async function hetznerRequest<T>(endpoint: string): Promise<T> {
|
||||
throw new Error(`Hetzner API error: ${response.status} ${response.statusText}`)
|
||||
}
|
||||
|
||||
return response.json()
|
||||
return response.json() as Promise<T>
|
||||
}
|
||||
|
||||
// Sincronizar lista de servidores
|
||||
|
||||
@@ -143,11 +143,11 @@ export async function getMonitoringData() {
|
||||
GROUP BY category
|
||||
`)
|
||||
|
||||
// Parse details JSON
|
||||
const itemsParsed = items.map(item => ({
|
||||
// Parse details JSON and cast to MonitoringItem
|
||||
const itemsParsed: MonitoringItem[] = items.map(item => ({
|
||||
...item,
|
||||
details: typeof item.details === 'string' ? JSON.parse(item.details) : item.details
|
||||
}))
|
||||
} as MonitoringItem))
|
||||
|
||||
// Organize by category
|
||||
const data: Record<string, MonitoringItem[]> = {}
|
||||
|
||||
Reference in New Issue
Block a user