diff --git a/package.json b/package.json index 7b7b72f74f..765d52c4ac 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "react-redux": "~7.2.0", "react-router": "~5.1.2", "react-router-dom": "~5.1.2", - "react-scripts": "~3.3.0", + "react-scripts": "~3.4.0", "redux": "~4.0.5", "redux-thunk": "~2.3.0", "typescript": "~3.8.2" diff --git a/src/locales/en-US/translation.json b/src/locales/en-US/translation.json index ce5f335d98..b402373404 100644 --- a/src/locales/en-US/translation.json +++ b/src/locales/en-US/translation.json @@ -9,7 +9,8 @@ "newPatient": "New Patient", "editPatient": "Edit Patient", "successfullyCreated": "Successfully created patient", - "successfullyUpdated": "Successfully updated patient" + "successfullyUpdated": "Successfully updated patient", + "successfullyAddedRelatedPerson": "Successfully added the new related person" }, "patient": { "suffix": "Suffix", diff --git a/src/patients/patient-slice.ts b/src/patients/patient-slice.ts index 5d6519f859..91fd375202 100644 --- a/src/patients/patient-slice.ts +++ b/src/patients/patient-slice.ts @@ -71,7 +71,11 @@ export const createPatient = (patient: Patient, history: any): AppThunk => async ) } -export const updatePatient = (patient: Patient, history: any): AppThunk => async (dispatch) => { +export const updatePatient = ( + patient: Patient, + history: any, + relatedPerson?: boolean, +): AppThunk => async (dispatch) => { dispatch(updatePatientStart()) const updatedPatient = await PatientRepository.saveOrUpdate(patient) dispatch(updatePatientSuccess(updatedPatient)) @@ -81,6 +85,14 @@ export const updatePatient = (patient: Patient, history: any): AppThunk => async il8n.t('Success!'), `${il8n.t('patients.successfullyUpdated')} ${patient.fullName}`, ) + if (relatedPerson) { + Toast( + 'success', + il8n.t('Success!'), + `${il8n.t('patients.successfullyAddedRelatedPerson')}`, + 'top-left', + ) + } } export default patientSlice.reducer diff --git a/src/patients/related-persons/RelatedPersonTab.tsx b/src/patients/related-persons/RelatedPersonTab.tsx index f3451dae19..ce078f424b 100644 --- a/src/patients/related-persons/RelatedPersonTab.tsx +++ b/src/patients/related-persons/RelatedPersonTab.tsx @@ -80,7 +80,7 @@ const RelatedPersonTab = (props: Props) => { relatedPersons: newRelatedPersons, } - dispatch(updatePatient(patientToUpdate, history)) + dispatch(updatePatient(patientToUpdate, history, true)) closeNewRelatedPersonModal() }