Skip to content

Commit d8496d0

Browse files
Skip search results page if there’s a single result (#250)
This skips the search results page if there’s a single result and instead goes straight to the patient details page. If there are multiple results, or no results, then different pages are shown, as before. In future, if we are able to show the details of multiple matches, then we could bring something like this back. ## Page removed <img width="1042" alt="Screenshot 2025-03-11 at 09 27 19" src="https://github.com/user-attachments/assets/23edc62d-5b43-4147-818b-d7c491cfced7" />
1 parent e510d31 commit d8496d0

File tree

2 files changed

+6
-53
lines changed

2 files changed

+6
-53
lines changed

app/routes/vaccinate.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ module.exports = router => {
215215

216216

217217
router.post('/vaccinate/patient-search', (req, res) => {
218-
218+
const data = req.session.data
219219
const firstName = req.session.data.firstName;
220220
const lastName = req.session.data.lastName;
221221
const dateOfBirth = req.session.data.dateOfBirth;
@@ -257,9 +257,12 @@ module.exports = router => {
257257
} else if (postcode === "") {
258258
res.redirect('/vaccinate/refine-search-result')
259259

260-
// Otherwise pretend there is a single result
260+
// Otherwise pretend there is a single result and
261+
// go to patient details page
261262
} else {
262-
res.redirect('/vaccinate/search-result')
263+
data.patientName = 'Jodie Brown'
264+
data.nhsNumber = '9123456788'
265+
res.redirect('/vaccinate/patient-history')
263266
}
264267
} else {
265268
res.render('vaccinate/patient-search', {

app/views/vaccinate/search-result.html

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)