main
ts 34 lines 894 Bytes
Raw
1 import type { Agent } from "@/types/agents"
2 import type { CommonResponse } from "@/types/common"
3 import { HttpClient } from "../httpClient"
4 import { withCustomerCodes } from "../params"
5
6 export default {
7 /**
8 * Get all agents for the authenticated customer
9 */
10 getAgents(customerCodes?: string[]) {
11 return HttpClient.get<CommonResponse<{ agents: Agent[] }>>("/agents", withCustomerCodes(customerCodes))
12 },
13
14 /**
15 * Get a specific agent by ID
16 */
17 getAgentById(agentId: string) {
18 return HttpClient.get<CommonResponse<{ agents: Agent[] }>>(`/agents/${agentId}`)
19 },
20
21 /**
22 * Mark agent as critical
23 */
24 markAgentAsCritical(agentId: string) {
25 return HttpClient.post<CommonResponse>(`/agents/${agentId}/critical`)
26 },
27
28 /**
29 * Mark agent as not critical
30 */
31 markAgentAsNotCritical(agentId: string) {
32 return HttpClient.post<CommonResponse>(`/agents/${agentId}/noncritical`)
33 }
34 }