Skip to content

Commit

Permalink
Remove success toast when updating or moving between sections
Browse files Browse the repository at this point in the history
  • Loading branch information
samau3 committed Oct 31, 2024
1 parent 1fd9b26 commit 0042398
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions client/src/pages/patients/register/PatientRegistration.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,6 @@ export default function PatientRegistration() {
try {
const res = await LifelineAPI.registerPatient(data, patientId);
if (res.status === StatusCodes.CREATED) {
showSuccessNotification(
'Patient basic information has been successfully registered.',
);
setShowCheck((prevShowCheck) => ({
...prevShowCheck,
patientData: true,
Expand All @@ -360,9 +357,6 @@ export default function PatientRegistration() {
patientId,
);
if (updateRes.status === StatusCodes.OK) {
showSuccessNotification(
'Patient basic information has been successfully updated.',
);
setShowCheck((prevShowCheck) => ({
...prevShowCheck,
patientData: true,
Expand Down Expand Up @@ -391,9 +385,6 @@ export default function PatientRegistration() {
try {
const res = await LifelineAPI.updatePatient(data, patientId);
if (res.status === StatusCodes.OK) {
showSuccessNotification(
'Patient information has been successfully updated.',
);
setShowCheck((prevShowCheck) => ({
...prevShowCheck,
[Object.keys(data)[0]]: true,
Expand All @@ -404,7 +395,9 @@ export default function PatientRegistration() {
throw new Error('Invalid data provided.');
}
if (res.status === StatusCodes.NOT_FOUND) {
throw new Error('Patient ID not found.');
throw new Error(
'Patient ID not found. Please ensure the Basic Information section is filled out correctly.',
);
}

throw new Error('Failed to update patient.');
Expand Down

0 comments on commit 0042398

Please sign in to comment.