Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update fields for new database schema #51

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/components/Admin/GetCardInfo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ const GetCardInfo = (props) => {
</div>
<div component="p">
Medications and History: {member.allergies}<br />
Ibuprofen Release: {!!member.ibuprofenRelease ? 'Yes' : 'No'}
Ibuprofen Release: {!!member.medicalInfo.ibuprofenRelease ? 'Yes' : 'No'}
</div>
<div component="p">
Insurance Company Name: {member.insurance.provider}<br />
Policy Number: {member.insurance.number}<br />
Group Name: {member.insurance.group}<br />
Insurance Company Name: {member.medicalInfo.insurance.provider}<br />
Policy Number: {member.medicalInfo.insurance.number}<br />
Group Name: {member.medicalInfo.insurance.group}<br />
</div>
</CardContent>

Expand Down
16 changes: 8 additions & 8 deletions src/components/Admin/RiderCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,14 @@ const GetCardInfo = (props) => {
</Detail>
<Detail>
<Typography variant='subtitle1'>
<em>Provider:</em> <Chip className={classes.chip} label={member.insurance.provider}/>
<em>Provider:</em> <Chip className={classes.chip} label={member.medicalInfo.insurance.provider}/>
</Typography>
</Detail>
<Detail>
<Typography variant='subtitle1'>
<em>Group:</em>
{groupView ?
<Chip className={classes.chip} label={member.insurance.group}/>
<Chip className={classes.chip} label={member.medicalInfo.insurance.group}/>
:
<Chip className={classes.chip} label="*******************"/>}
<VisibilityIcon onClick={_handleViewClick}/>
Expand All @@ -201,7 +201,7 @@ const GetCardInfo = (props) => {
<Typography variant='subtitle1'>
<em>Number:</em>
{numberView ?
<Chip className={classes.chip} label={member.insurance.number}/>
<Chip className={classes.chip} label={member.medicalInfo.insurance.number}/>
:
<Chip className={classes.chip} label="*********************"/>}
<VisibilityIcon onClick={_handleViewClick2}/>
Expand All @@ -217,7 +217,7 @@ const GetCardInfo = (props) => {
</Title>
<Detail>
<Typography variant='subtitle1'>
Ibuprofen Release: {!!member.ibuprofenRelease === true ?
Ibuprofen Release: {!!member.medicalInfo.ibuprofenRelease === true ?
<Chip
className={classes.chipYes}
label="Yes"
Expand All @@ -236,19 +236,19 @@ const GetCardInfo = (props) => {
History:
</Typography>
<Divider />
{member.medicalCondition = true ? <Chip
{member.medicalInfo.medicalCondition = true ? <Chip
className={classes.chip}
label="Medical Condition"
color="secondary"
/>
: null }
{member.asthma = true ? <Chip
{member.medicalInfo.asthma = true ? <Chip
className={classes.chip}
label="Asthma"
color="secondary"
/>
: null }
{member.medicationRequired =true ? <Chip
{member.medicalInfo.medicationRequired =true ? <Chip
className={classes.chip}
label="Medication Needed"
color="secondary"
Expand All @@ -261,7 +261,7 @@ const GetCardInfo = (props) => {
</Typography>
<Divider />
<Typography variant='subtitle1'>
{member.allergies}
{member.medicalInfo.allergies}
</Typography>
</Detail>
</Paper>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Admin/UploadPhoto.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const UploadPhoto = ({user, setUser, setProfilePicture, setUpdateProfilePicture}
.then(async function(url) {

const response = await fetch(
`${process.env.REACT_APP_SERVER_URL}/user/update/${user._id}`,
`${process.env.REACT_APP_SERVER_URL}/user/update/profilepic/${user._id}`,
{
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
Expand Down
16 changes: 8 additions & 8 deletions src/components/User/User.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -336,14 +336,14 @@ const User = (props) => {
</Detail>
<Detail>
<Typography variant='subtitle1'>
<em>Provider:</em> <Chip className={classes.chip} label={user.insurance.provider}/>
<em>Provider:</em> <Chip className={classes.chip} label={user.medicalInfo.insurance.provider}/>
</Typography>
</Detail>
<Detail>
<Typography variant='subtitle1'>
<em>Group:</em>
{groupView ?
<Chip className={classes.chip} label={user.insurance.group}/>
<Chip className={classes.chip} label={user.medicalInfo.insurance.group}/>
:
<Chip className={classes.chip} label="*******************"/>}
<VisibilityIcon onClick={_handleViewClick}/>
Expand All @@ -353,7 +353,7 @@ const User = (props) => {
<Typography variant='subtitle1'>
<em>Number:</em>
{numberView ?
<Chip className={classes.chip} label={user.insurance.number}/>
<Chip className={classes.chip} label={user.medicalInfo.insurance.number}/>
:
<Chip className={classes.chip} label="*********************"/>}
<VisibilityIcon onClick={_handleViewClick2}/>
Expand All @@ -371,7 +371,7 @@ const User = (props) => {
</Title>
<Detail>
<Typography variant='subtitle1'>
Ibuprofen Release: {!!user.ibuprofenRelease === true ?
Ibuprofen Release: {!!user.medicalInfo.ibuprofenRelease === true ?
<Chip
className={classes.chipYes}
label="Yes"
Expand All @@ -390,19 +390,19 @@ const User = (props) => {
History:
</Typography>
<Divider />
{user.medicalCondition = true ? <Chip
{user.medicalInfo.medicalCondition = true ? <Chip
className={classes.chip}
label="Medical Condition"
color="secondary"
/>
: null }
{user.asthma = true ? <Chip
{user.medicalInfo.asthma = true ? <Chip
className={classes.chip}
label="Asthma"
color="secondary"
/>
: null }
{user.medicationRequired =true ? <Chip
{user.medicalInfo.medicationRequired =true ? <Chip
className={classes.chip}
label="Medication Needed"
color="secondary"
Expand All @@ -415,7 +415,7 @@ const User = (props) => {
</Typography>
<Divider />
<Typography variant='subtitle1'>
{user.allergies}
{user.medicalInfo.allergies}
</Typography>
</Detail>
</Paper>
Expand Down
25 changes: 14 additions & 11 deletions src/components/User/UserProfile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ const UserProfile = ({user, setUser, setProfilePicture, profilePicture}) =>{
const [emergencyContactTwoCellPhone, setEmergencyContactTwoCellPhone] = useState(user.parentForm.emergencyContactTwo.phone.cell);
const [emergencyContactTwoHomePhone, setEmergencyContactTwoHomePhone] = useState(user.parentForm.emergencyContactTwo.phone.home);

const [insuranceProvider, setInsuranceProvider] = useState(user.insurance.provider);
const [insurancePolicyNumber, setInsurancePolicyNumber] = useState(user.insurance.number);
const [insuranceGroup, setInsuranceGroup] = useState(user.insurance.group);
const [insuranceProvider, setInsuranceProvider] = useState(user.medicalInfo.insurance.provider);
const [insurancePolicyNumber, setInsurancePolicyNumber] = useState(user.medicalInfo.insurance.number);
const [insuranceGroup, setInsuranceGroup] = useState(user.medicalInfo.insurance.group);

const [ibReleaseRadio, setIbReleaseRadio] = useState(String(user.ibuprofenRelease));
const [ibReleaseRadio, setIbReleaseRadio] = useState(String(user.medicalInfo.ibuprofenRelease));


const _handleRiderFirstName = input => {
Expand Down Expand Up @@ -243,7 +243,10 @@ const UserProfile = ({user, setUser, setProfilePicture, profilePicture}) =>{
cell: emergencyContactTwoCellPhone,
home: emergencyContactTwoHomePhone
}
},
}

},
medicalInfo: {
insurance: {
provider: insuranceProvider,
group: insuranceGroup,
Expand Down Expand Up @@ -284,7 +287,7 @@ const UserProfile = ({user, setUser, setProfilePicture, profilePicture}) =>{



<Container component='RiderInformation'>
<Container>
<Section>
<Title>
<h2>Rider Information</h2>
Expand Down Expand Up @@ -326,7 +329,7 @@ const UserProfile = ({user, setUser, setProfilePicture, profilePicture}) =>{



<Container component='ParentOneInformation' className={classes.marginTop}>
<Container className={classes.marginTop}>
<Section>
<Title>
<h2>Account/Parent One Information</h2>
Expand Down Expand Up @@ -375,7 +378,7 @@ const UserProfile = ({user, setUser, setProfilePicture, profilePicture}) =>{
</Section>
</Container>

<Container component='ParentTwoInformation' className={classes.marginTop}>
<Container className={classes.marginTop}>
<Section>
<Title>
<h2>Parent Two Information</h2>
Expand Down Expand Up @@ -413,7 +416,7 @@ const UserProfile = ({user, setUser, setProfilePicture, profilePicture}) =>{
</Section>
</Container>

<Container component="Emergencycontact" className={classes.marginTop}>
<Container className={classes.marginTop}>
<Section>
<Title>
<h2>Emergency Contact One</h2>
Expand Down Expand Up @@ -456,7 +459,7 @@ const UserProfile = ({user, setUser, setProfilePicture, profilePicture}) =>{
</Section>
</Container>

<Container component="Emergencycontact" className={classes.marginTop}>
<Container className={classes.marginTop}>
<Section>
<Title>
<h2>Emergency Contact Two</h2>
Expand Down Expand Up @@ -497,7 +500,7 @@ const UserProfile = ({user, setUser, setProfilePicture, profilePicture}) =>{
</Section>
</Container>

<Container component='Insurance' className={classes.marginTop}>
<Container className={classes.marginTop}>
<Section>
<Title>
<h2>Insurance Information</h2>
Expand Down