Skip to content

Commit

Permalink
Merge pull request #74 from FAC-11/emptyform-bug
Browse files Browse the repository at this point in the history
#53 fixes bug which stopped sections from loading
  • Loading branch information
rebecacalvoquintero authored Oct 12, 2017
2 parents bf5cfe1 + 126cdf1 commit 4d827c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/controllers/appointments.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ exports.get = (req, res) => {
getSection(req.session.id, 'appointments'),
getSection(req.session.id, 'closing'),
]).then((dataArr) => {
const data = Object.assign(dataArr[0], dataArr[1]);
const data = Object.assign(dataArr[0] || {}, dataArr[1] || {});
// for ticking correct checkbox based on previously saved answer
const contactMethods = data.contact_preference ? data.contact_preference.replace(/\{|\}/g, '').split(',') : [];
let checked = {
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/symptoms.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports.get = (req, res) => {
getSection(req.session.id, 'symptoms')
.then((data) => {
let checked = {
agreement: { [data.diagnosis_agreement]: true },
agreement: { [data ? data.diagnosis_agreement : '']: true },
};
res.render('symptoms', {
activePage: { symptoms: true },
Expand Down

0 comments on commit 4d827c6

Please sign in to comment.