feature: treatment frontend wired with the newly implemented backend. no mocked data no more.

This commit is contained in:
2026-05-19 23:43:43 +03:30
parent f743046b38
commit 633c939560
13 changed files with 1199 additions and 528 deletions

View File

@@ -5,6 +5,7 @@ import type {
SaveTreatmentPayload,
SendTreatmentCasePayload,
TreatmentAttachmentMeta,
TreatmentCaseSendInfo,
} from '@/types/treatment';
export const treatmentsApi = {
@@ -62,6 +63,14 @@ export const treatmentsApi = {
const response = await apiClient.post(`/treatments/cases/${caseId}/send`, payload);
return response.data;
},
getAttachmentFileBlob: async (attachmentId: string): Promise<Blob> => {
const response = await apiClient.get(`/treatments/attachments/${attachmentId}/file`, {
responseType: 'blob',
timeout: 120_000,
});
return response.data;
},
};
export interface PastTreatmentCaseResponse {
@@ -72,5 +81,6 @@ export interface PastTreatmentCaseResponse {
notes: string | null;
sentAt: string | null;
sendToOrganizationIds: string[];
sends: TreatmentCaseSendInfo[];
attachmentMetas: TreatmentAttachmentMeta[];
}