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