| 1 | import type { FlaskBaseResponse } from "@/types/flask.d" |
| 2 | import type { AITrigger } from "@/types/incidentManagement/aiTriggers.d" |
| 3 | import { HttpClient } from "../../httpClient" |
| 4 | |
| 5 | export interface AITriggerPayload { |
| 6 | customer_code: string |
| 7 | enabled: boolean |
| 8 | } |
| 9 | |
| 10 | export default { |
| 11 | getAITriggers(customerCode: string) { |
| 12 | return HttpClient.get<FlaskBaseResponse & { ai_triggers: AITrigger[] }>( |
| 13 | `/incidents/db_operations/ai_trigger/${customerCode}` |
| 14 | ) |
| 15 | }, |
| 16 | setAITrigger(notification: AITriggerPayload) { |
| 17 | return HttpClient.put<FlaskBaseResponse & { ai_triggers: AITrigger[] }>( |
| 18 | `/incidents/db_operations/ai_trigger`, |
| 19 | notification, |
| 20 | { |
| 21 | params: { |
| 22 | customer_code: notification.customer_code |
| 23 | } |
| 24 | } |
| 25 | ) |
| 26 | } |
| 27 | } |