Skip to content

Commit

Permalink
Corrigindo bug de não atualizar a agenda após criar consulta
Browse files Browse the repository at this point in the history
  • Loading branch information
vinniciusgomes committed Nov 30, 2020
1 parent d88d213 commit 4c41657
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const CreateAppointmentModal: React.FC<ICreateAppointmentModal> = ({
doctorId,
doctorName,
close,
getAppointments,
}) => {
const [hasError, setHasError] = useState(false);
const [patientDocument, setPatientDocument] = useState('');
Expand Down Expand Up @@ -61,6 +62,7 @@ const CreateAppointmentModal: React.FC<ICreateAppointmentModal> = ({
if (response.data.id) {
message.success('Consulta agendada com sucesso!');
handleResetForm();
getAppointments();
close();
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ export interface ICreateAppointmentModal {
doctorId: string;
doctorName: string;
close(): void;
getAppointments(): void;
}
1 change: 1 addition & 0 deletions src/modules/secretary/pages/Schedule/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ const Schedule: React.FC = () => {
<CreateAppointmentModal
doctorId={doctorId}
doctorName={doctorName}
getAppointments={() => getAppointments()}
close={() => setVisible(false)}
/>
</Modal>
Expand Down

1 comment on commit 4c41657

@vercel
Copy link

@vercel vercel bot commented on 4c41657 Nov 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.