improvement: treatments UI/UX updated again to minimize clicking and scrolling.
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user