{"size": 718, "ext": "js", "max_stars_repo_path": "packages/lpa-questionnaire-web-app/src/controllers/confirm-answers.js", "max_stars_repo_name": "Planning-Inspectorate/appeal-planning-decision", "max_stars_repo_stars_event_min_datetime": "2021-03-22T16:33:15.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-14T21:59:24.000Z", "max_issues_repo_path": "packages/lpa-questionnaire-web-app/src/controllers/confirm-answers.js", "max_issues_repo_name": "Planning-Inspectorate/appeal-planning-decision", "max_issues_repo_issues_event_min_datetime": "2021-02-22T14:33:35.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-29T21:15:46.000Z", "max_forks_repo_path": "packages/lpa-questionnaire-web-app/src/controllers/confirm-answers.js", "max_forks_repo_name": "foundry4/appeal-planning-decision", "max_forks_repo_forks_event_min_datetime": "2020-10-23T14:41:11.000Z", "max_forks_repo_forks_event_max_datetime": "2021-01-28T09:35:31.000Z"}
{"max_stars_count": 5, "max_issues_count": 189, "max_forks_count": 4, "avg_line_length": 35.9, "max_line_length": 91, "alphanum_fraction": 0.6991643454}
const { VIEW } = require('../lib/views');
const checkAnswersSections = require('../lib/check-answers-sections');
const { renderView } = require('../util/render');

module.exports = (req, res) => {
  req.session.isCheckingAnswers = true;
  const { appealReply } = req.session;
  const sections = checkAnswersSections(appealReply, req.params.id);

  // Set backLink property in session
  req.session.backLink = `/${req.params.id}/${VIEW.CONFIRM_ANSWERS}`;

  renderView(res, VIEW.CONFIRM_ANSWERS, {
    prefix: 'appeal-questionnaire',
    submissionLink: `/appeal-questionnaire/${req.params.id}/${VIEW.INFORMATION_SUBMITTED}`,
    taskListLink: `/appeal-questionnaire/${req.params.id}/task-list`,
    sections,
  });
};
