improvement: treatments UI/UX updated again to minimize clicking and scrolling.

This commit is contained in:
2026-08-19 23:59:37 +03:30
parent 29c639f5a1
commit d2f07c0ed3
33 changed files with 1651 additions and 744 deletions

View File

@@ -61,6 +61,11 @@ export const casesApi = {
return response.data;
},
deleteDraft: async (id: string): Promise<{ success: boolean }> => {
const response = await apiClient.delete(`/cases/${id}`);
return response.data;
},
uploadLineAttachments: async (
caseId: string,
lineClientId: string,

View File

@@ -95,6 +95,7 @@ export const treatmentsApi = {
treatmentId: string,
detailClientId: string,
files: File[],
onUploadProgress?: (percent: number) => void,
): Promise<{ success: boolean; data: import('@/types/treatment').TreatmentAttachmentMeta[] }> => {
const form = new FormData();
for (const file of files) {
@@ -103,7 +104,16 @@ export const treatmentsApi = {
const response = await apiClient.post(
`/treatments/${treatmentId}/details/${encodeURIComponent(detailClientId)}/attachments`,
form,
{ headers: { 'Content-Type': 'multipart/form-data' }, timeout: 120_000 },
{
headers: { 'Content-Type': 'multipart/form-data' },
timeout: 120_000,
onUploadProgress: onUploadProgress
? (event) => {
if (!event.total) return;
onUploadProgress(Math.round((event.loaded / event.total) * 100));
}
: undefined,
},
);
return response.data;
},
@@ -131,6 +141,7 @@ export const treatmentsApi = {
appointmentId: string,
detailClientId: string,
files: File[],
onUploadProgress?: (percent: number) => void,
): Promise<{ success: boolean; data: import('@/types/treatment').TreatmentAttachmentMeta[] }> => {
const form = new FormData();
for (const file of files) {
@@ -139,7 +150,16 @@ export const treatmentsApi = {
const response = await apiClient.post(
`/treatments/appointments/${appointmentId}/details/${encodeURIComponent(detailClientId)}/attachments`,
form,
{ headers: { 'Content-Type': 'multipart/form-data' }, timeout: 120_000 },
{
headers: { 'Content-Type': 'multipart/form-data' },
timeout: 120_000,
onUploadProgress: onUploadProgress
? (event) => {
if (!event.total) return;
onUploadProgress(Math.round((event.loaded / event.total) * 100));
}
: undefined,
},
);
return response.data;
},