Skip to content

Commit

Permalink
#53 fixes bug with saving and loading closing table
Browse files Browse the repository at this point in the history
  • Loading branch information
dangerdak committed Oct 12, 2017
1 parent 3b4f970 commit 45862ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/controllers/appointments.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ exports.get = (req, res) => {
getSection(req.session.id, 'closing'),
]).then((dataArr) => {
const data = Object.assign(dataArr[0] || {}, dataArr[1] || {});
console.log(data);
// for ticking correct checkbox based on previously saved answer
const contactMethods = data.contact_preference ? data.contact_preference.replace(/\{|\}/g, '').split(',') : [];
let checked = {
Expand Down
4 changes: 2 additions & 2 deletions src/views/appointments.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@

<li class="f5 black-60 db mb2 tracked pt3 pb3 mr2"> <span class='li mr2'>&rarr;</span> Do you have any concerns about moving to a different service and if so, what are they?
<br>
<textarea class="mt3 w-80 mw7 vh-5 ba b--black-30 br3 h4" type="text" name="concerns" rows="8" cols="80" placeholder="Write here please" aria-label='please let us know your concerns' value="{{data.concerns}}"></textarea>
<textarea class="mt3 w-80 mw7 vh-5 ba b--black-30 br3 h4" type="text" name="concerns" rows="8" cols="80" placeholder="Write here please" aria-label='please let us know your concerns'>{{data.concerns}}</textarea>
</li>

<li class="f5 black-60 db mb2 tracked pt3 pb3 mr2"> <span class='li mr2'>&rarr;</span> I hope that when I leave I am...
<br>
<textarea class="mt3 w-80 mw7 vh-5 ba b--black-30 br3 h4" type="text" name="home" rows="8" cols="80" placeholder="Write here please" aria-label='please let us know what you hope happens when you leave' value="{{data.hope}}"></textarea>
<textarea class="mt3 w-80 mw7 vh-5 ba b--black-30 br3 h4" type="text" name="hope" rows="8" cols="80" placeholder="Write here please" aria-label='please let us know what you hope happens when you leave'>{{data.hope}}</textarea>
</li>
</ol>

Expand Down

0 comments on commit 45862ce

Please sign in to comment.