fix: Исправление UI и API
Исправлены ошибки UI, API и добавлены улучшения.
This commit is contained in:
parent
76b72dce1c
commit
7574b08b25
@ -44,7 +44,7 @@ export const lensesApi = createApi({
|
||||
method: 'POST',
|
||||
body: lens
|
||||
}),
|
||||
invalidatesTags: ['Lens']
|
||||
invalidatesTags: ['Lenses']
|
||||
}),
|
||||
updateLens: builder.mutation({
|
||||
query: ({id, ...lens}) => ({
|
||||
@ -52,14 +52,14 @@ export const lensesApi = createApi({
|
||||
method: 'PUT',
|
||||
body: lens
|
||||
}),
|
||||
invalidatesTags: ['Lens']
|
||||
invalidatesTags: ['Lenses']
|
||||
}),
|
||||
deleteLens: builder.mutation({
|
||||
query: (id) => ({
|
||||
url: `/lenses/${id}/`,
|
||||
method: 'DELETE'
|
||||
}),
|
||||
invalidatesTags: ['Lens']
|
||||
invalidatesTags: ['Lenses']
|
||||
}),
|
||||
}),
|
||||
});
|
||||
|
||||
@ -23,7 +23,7 @@ export const patientsApi = createApi({
|
||||
url: '/patients/',
|
||||
params: { all_params: true },
|
||||
}),
|
||||
providesTags: ['Patient'],
|
||||
providesTags: ['Patients'],
|
||||
transformResponse: (response) => {
|
||||
if (!response || !Array.isArray(response.patients)) {
|
||||
console.warn('Unexpected patients API response:', response);
|
||||
@ -38,7 +38,7 @@ export const patientsApi = createApi({
|
||||
method: 'POST',
|
||||
body: patient
|
||||
}),
|
||||
invalidatesTags: ['Patient']
|
||||
invalidatesTags: ['Patients']
|
||||
}),
|
||||
updatePatient: builder.mutation({
|
||||
query: ({id, ...patient}) => ({
|
||||
@ -46,14 +46,14 @@ export const patientsApi = createApi({
|
||||
method: 'PUT',
|
||||
body: patient
|
||||
}),
|
||||
invalidatesTags: ['Patient']
|
||||
invalidatesTags: ['Patients']
|
||||
}),
|
||||
deletePatient: builder.mutation({
|
||||
query: (id) => ({
|
||||
url: `/patients/${id}/`,
|
||||
method: 'DELETE'
|
||||
}),
|
||||
invalidatesTags: ['Patient']
|
||||
invalidatesTags: ['Patients']
|
||||
}),
|
||||
}),
|
||||
});
|
||||
|
||||
@ -229,6 +229,7 @@ const AppointmentFormModal = () => {
|
||||
|
||||
const ConfirmStep = useMemo(() => {
|
||||
const values = appointmentFormModalUI.form.getFieldsValue();
|
||||
const formValues = appointmentFormModalUI.formValues;
|
||||
const patient = appointmentFormModalData.patients.find((p) => p.id === values.patient_id);
|
||||
const appointmentType = appointmentFormModalData.appointmentTypes.find((t) => t.id === values.type_id);
|
||||
|
||||
@ -251,7 +252,7 @@ const AppointmentFormModal = () => {
|
||||
<p>
|
||||
<b>Результаты приема:</b>
|
||||
</p>
|
||||
<div dangerouslySetInnerHTML={{__html: values.results || "Не указаны"}}/>
|
||||
<div dangerouslySetInnerHTML={{__html: formValues.results || "Не указаны"}}/>
|
||||
<p>
|
||||
<b>Прикрепленные файлы:</b>
|
||||
</p>
|
||||
|
||||
@ -422,6 +422,7 @@ const useAppointmentFormModalUI = (createAppointment, patients, cancelAppointmen
|
||||
screenXS,
|
||||
direction,
|
||||
isDrawerVisible,
|
||||
formValues,
|
||||
showDrawer,
|
||||
closeDrawer,
|
||||
isLoadingPreviousAppointments,
|
||||
|
||||
@ -51,7 +51,7 @@ const MainLayout = () => {
|
||||
collapsible={!mainLayoutUI.screens.xs}
|
||||
collapsed={mainLayoutUI.collapsed}
|
||||
onCollapse={mainLayoutUI.setCollapsed}
|
||||
style={{height: "100vh", position: "fixed", left: 0}}
|
||||
style={{height: "100vh", position: "fixed", left: 0, overflow: "auto"}}
|
||||
>
|
||||
<div style={{display: "flex", justifyContent: "center", padding: 16}}>
|
||||
<img
|
||||
|
||||
@ -150,7 +150,7 @@ const PatientsPage = () => {
|
||||
|
||||
{patientsData.isLoading ? <LoadingIndicator/> : patientsData.viewMode === "tile" ? (
|
||||
<List
|
||||
grid={{gutter: 16, column: 3}}
|
||||
grid={{ gutter: 16, xs: 1, sm: 1, md: 2, lg: 3, xl: 4 }}
|
||||
dataSource={patientsData.filteredPatients}
|
||||
renderItem={patient => (
|
||||
<List.Item>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user