improvement: users can now comment on a case and it's details and have an option to make it visible for clinics too.

This commit is contained in:
2026-07-07 17:14:31 +03:30
parent cb63ced4e3
commit b2d40b3e97
21 changed files with 467 additions and 269 deletions

View File

@@ -1,4 +1,5 @@
import { apiClient } from './client';
import type { LabCaseComment } from '@/types/cases';
import type {
LabCaseResponse,
LinkedOrganizationOption,
@@ -82,6 +83,21 @@ export const treatmentsApi = {
return response.data;
},
listLabCaseComments: async (
labCaseId: string,
): Promise<{ success: boolean; data: LabCaseComment[] }> => {
const response = await apiClient.get(`/treatments/lab-cases/${labCaseId}/comments`);
return response.data;
},
addLabCaseComment: async (
labCaseId: string,
payload: { body: string },
): Promise<{ success: boolean; data: LabCaseComment }> => {
const response = await apiClient.post(`/treatments/lab-cases/${labCaseId}/comments`, payload);
return response.data;
},
getAttachmentFileBlob: async (attachmentId: string): Promise<Blob> => {
const response = await apiClient.get(`/treatments/attachments/${attachmentId}/file`, {
responseType: 'blob',