main
ts 20 lines 843 Bytes
Raw
1 import type { CaseEvent, CaseTask } from "@/types/caseTemplates"
2 import type { CommonResponse } from "@/types/common"
3 import { HttpClient } from "../httpClient"
4
5 // Read-only endpoints the customer portal consumes (issue #792).
6 // All write paths are gated to admin/analyst on the backend; this client
7 // intentionally exposes only GET surfaces so customers see what the SOC
8 // team is doing on their cases without being able to mutate.
9
10 export default {
11 getCaseTasks(caseId: number) {
12 return HttpClient.get<CommonResponse<{ tasks: CaseTask[] }>>(`/incidents/db_operations/case/${caseId}/tasks`)
13 },
14 getCaseTimeline(caseId: number, limit = 500, offset = 0) {
15 return HttpClient.get<CommonResponse<{ case_id: number; events: CaseEvent[] }>>(
16 `/incidents/db_operations/case/${caseId}/timeline`,
17 { params: { limit, offset } }
18 )
19 }
20 }