fix: Исправлены ошибки в формах и запросах данных

This commit is contained in:
Андрей Дувакин 2025-07-04 09:28:46 +05:00
parent ac70c09509
commit 90f3ab8ab1
4 changed files with 7 additions and 7 deletions

View File

@ -228,10 +228,9 @@ const AppointmentFormModal = () => {
]); ]);
const ConfirmStep = useMemo(() => { const ConfirmStep = useMemo(() => {
const values = appointmentFormModalUI.form.getFieldsValue();
const formValues = appointmentFormModalUI.formValues; const formValues = appointmentFormModalUI.formValues;
const patient = appointmentFormModalData.patients.find((p) => p.id === values.patient_id); const patient = appointmentFormModalData.patients.find((p) => p.id === formValues.patient_id);
const appointmentType = appointmentFormModalData.appointmentTypes.find((t) => t.id === values.type_id); const appointmentType = appointmentFormModalData.appointmentTypes.find((t) => t.id === formValues.type_id);
return ( return (
<div style={appointmentFormModalUI.blockStepStyle}> <div style={appointmentFormModalUI.blockStepStyle}>
@ -244,10 +243,10 @@ const AppointmentFormModal = () => {
</p> </p>
<p> <p>
<b>Время приема:</b>{" "} <b>Время приема:</b>{" "}
{values.appointment_datetime ? dayjs(values.appointment_datetime).format("DD.MM.YYYY HH:mm") : "Не указано"} {formValues.appointment_datetime ? dayjs(formValues.appointment_datetime).format("DD.MM.YYYY HH:mm") : "Не указано"}
</p> </p>
<p> <p>
<b>Дней до следующего приема:</b> {values.days_until_the_next_appointment || "Не указано"} <b>Дней до следующего приема:</b> {formValues.days_until_the_next_appointment || "Не указано"}
</p> </p>
<p> <p>
<b>Результаты приема:</b> <b>Результаты приема:</b>

View File

@ -274,7 +274,7 @@ const useAppointmentFormModalUI = (createAppointment, patients, cancelAppointmen
} else if (currentStep === 1) { } else if (currentStep === 1) {
try { try {
const values = await form.validateFields(); const values = await form.validateFields();
setFormValues(values); setFormValues({...values, patient_id: selectedPatient.id});
setCurrentStep(2); setCurrentStep(2);
} catch (error) { } catch (error) {
notification.error({ notification.error({

View File

@ -70,6 +70,7 @@ const MailingPage = () => {
value={searchQuery} value={searchQuery}
onChange={handleSearchChange} onChange={handleSearchChange}
style={{ marginBottom: 16, width: isMobile ? "100%" : 300 }} style={{ marginBottom: 16, width: isMobile ? "100%" : 300 }}
allowClear
/> />
<Table <Table
rowSelection={{ rowSelection={{

View File

@ -29,7 +29,7 @@ const useProfilePage = () => {
error: sessionsError, error: sessionsError,
} = useGetSessionsQuery(undefined, { } = useGetSessionsQuery(undefined, {
skip: !user, skip: !user,
pollingInterval: 20000, pollingInterval: 5000,
}); });
const [logoutSession, {isLoading: isLoggingOutSession}] = useLogoutSessionMutation(); const [logoutSession, {isLoading: isLoggingOutSession}] = useLogoutSessionMutation();