feature: treatment frontend wired with the newly implemented backend. no mocked data no more.
This commit is contained in:
@@ -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[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user