Skip to content

Commit

Permalink
Properly extract the relevant fields from preexisting contact data
Browse files Browse the repository at this point in the history
  • Loading branch information
samau3 committed Sep 12, 2024
1 parent 338c772 commit 8c48956
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion client/src/pages/patients/PatientRegistration.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,11 @@ export default function PatientRegistration() {
dateOfBirth: new Date(dateOfBirth),
};
const contactData = {
...emergencyContact,
firstName: emergencyContact?.firstName || '',
middleName: emergencyContact?.middleName || '',
lastName: emergencyContact?.lastName || '',
email: emergencyContact?.email || '',
relationship: emergencyContact?.relationship || null,
phone: emergencyContact?.phone || '',
};
const medicalData = {
Expand All @@ -214,6 +218,8 @@ export default function PatientRegistration() {
// eslint-disable-next-line
}, [data]);

console.log(form.getValues());

const showSuccessNotification = (message) => {
notifications.show({
title: 'Success',
Expand Down

0 comments on commit 8c48956

Please sign in to comment.