| 1 | import type { CommonResponse } from "@/types/common" |
| 2 | import type { AlertsStats, CasesStats, DashboardStats, PortalSettings } from "@/types/portal" |
| 3 | import { HttpClient } from "../httpClient" |
| 4 | import { withCustomerCodes } from "../params" |
| 5 | |
| 6 | export default { |
| 7 | getSettings() { |
| 8 | return HttpClient.get<CommonResponse<{ settings: PortalSettings }>>("/customer_portal/settings") |
| 9 | }, |
| 10 | dashboardStats(customerCodes?: string[]) { |
| 11 | return HttpClient.get<CommonResponse<DashboardStats>>( |
| 12 | "/customer_portal/dashboard/stats", |
| 13 | withCustomerCodes(customerCodes) |
| 14 | ) |
| 15 | }, |
| 16 | alertsStats(customerCodes?: string[]) { |
| 17 | return HttpClient.get<CommonResponse<AlertsStats>>( |
| 18 | "/customer_portal/dashboard/alert-stats", |
| 19 | withCustomerCodes(customerCodes) |
| 20 | ) |
| 21 | }, |
| 22 | casesStats(customerCodes?: string[]) { |
| 23 | return HttpClient.get<CommonResponse<CasesStats>>( |
| 24 | "/customer_portal/dashboard/case-stats", |
| 25 | withCustomerCodes(customerCodes) |
| 26 | ) |
| 27 | } |
| 28 | } |