import { api } from './client'

export function fetchAlertSummary({ severity, department, from, to } = {}) {
  const params = new URLSearchParams()
  if (severity) params.set('severity', severity)
  if (department) params.set('department', department)
  if (from) params.set('from', from)
  if (to) params.set('to', to)
  const qs = params.toString()
  return api.get(`/api/v1/analytics/alerts/summary${qs ? `?${qs}` : ''}`)
}
