Skip to content

Commit

Permalink
fix delete
Browse files Browse the repository at this point in the history
  • Loading branch information
salimkanoun committed Sep 7, 2024
1 parent 9e81b52 commit 3974f30
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/content/ContentRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ const ContentRoot: React.FC = () => {
patient={patient}
onDeletePatient={handleDeletePatient}
onEditPatient={(patient) => setEditingPatient(patient)}
onStudyUpdated={() => refreshFind()}
/>
))
)}
Expand Down
5 changes: 3 additions & 2 deletions src/content/patients/AccordionPatient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ import { AccordionHeader } from "../../ui/Accordion";
type AccordionPatientProps = {
patient: Patient;
onEditPatient: (patient :Patient) => void;
onStudyUpdated: (patient :Patient) => void;
onDeletePatient: (patient :Patient) => void;
};

const AccordionPatient: React.FC<AccordionPatientProps> = ({ patient, onEditPatient, onDeletePatient }) => {
const AccordionPatient: React.FC<AccordionPatientProps> = ({ patient, onEditPatient, onDeletePatient, onStudyUpdated }) => {
const [selectedStudyId, setSelectedStudyId] = useState<string | null>(null);

const handleStudySelected = (studyId: string) => {
Expand Down Expand Up @@ -55,7 +56,7 @@ const AccordionPatient: React.FC<AccordionPatientProps> = ({ patient, onEditPati
<div className={`${!selectedStudyId ? 'lg:col-span-2' : ''}`}>
<StudyRoot
patient={patient}
onStudyUpdated={() => onEditPatient(patient)}
onStudyUpdated={() => onStudyUpdated(patient)}
onStudySelected={handleStudySelected}
/>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/content/series/SeriesRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ const SeriesRoot: React.FC<SeriesRootProps> = ({ studyId }) => {
toastSuccess('Series deleted successfully');
refetchSeries();
},
onError: (error: any) => {
toastError(`Failed to delete series ${error}`);
onError: () => {
toastError(`Failed to delete series`);
},
}
);
Expand Down
2 changes: 1 addition & 1 deletion src/content/studies/StudyRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const StudyRoot: React.FC<StudyRootProps> = ({ patient, onStudyUpdated, onStudyS
onStudyUpdated();
},
onError: (error: any) => {
toastError('Failed to delete study: ' + error);
toastError('Failed to delete study');
},
}
);
Expand Down

0 comments on commit 3974f30

Please sign in to comment.