Skip to content

Commit 3a3970f

Browse files
Remove unused activity query from patient session urls
1 parent a957764 commit 3a3970f

4 files changed

Lines changed: 11 additions & 19 deletions

File tree

app/controllers/patient-session.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export const patientSessionController = {
2222
read(request, response, next, nhsn) {
2323
const { account } = request.app.locals
2424
const { programme_id, session_id } = request.params
25-
const { activity } = request.query
2625
const { __ } = response.locals
2726

2827
const patientSession = PatientSession.findAll(request.session.data)
@@ -127,27 +126,20 @@ export const patientSessionController = {
127126
icon: 'tick'
128127
}),
129128
text: patientSession.programme.name,
130-
href: activity
131-
? `${patientSession.uri}?activity=${activity}`
132-
: patientSession.uri,
129+
href: patientSession.uri,
133130
current:
134131
view !== 'events' && patientSession.programme_id === programme_id
135132
})),
136133
...[
137134
{
138135
text: __('patientSession.events.title'),
139-
href: activity
140-
? `${patientSession.uri}/events?activity=${activity}`
141-
: `${patientSession.uri}/events`,
136+
href: `${patientSession.uri}/events`,
142137
current: view === 'events'
143138
}
144139
]
145140
]
146141

147-
response.locals.activity = activity
148-
response.locals.referrer = activity
149-
? `${patientSession.uri}?activity=${activity}`
150-
: patientSession.uri
142+
response.locals.referrer = patientSession.uri
151143
response.locals.patientProgramme = patientProgramme
152144
response.locals.patientSession = patientSession
153145
response.locals.patient = patient

app/controllers/reply.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const replyController = {
7979
const { account, invalidUuid } = request.app.locals
8080
const { reply_uuid } = request.params
8181
const { data } = request.session
82-
const { __, activity, patientSession, triage } = response.locals
82+
const { __, patientSession, triage } = response.locals
8383

8484
let reply
8585
let next
@@ -90,7 +90,7 @@ export const replyController = {
9090
Reply.update(reply_uuid, request.body.reply, data)
9191
} else {
9292
reply = new Reply(Reply.findOne(reply_uuid, data.wizard), data)
93-
next = `${patientSession.uri}?activity=${activity || 'consent'}`
93+
next = patientSession.uri
9494

9595
// Remove any parent details in reply if self consent
9696
if (reply.selfConsent) {
@@ -402,7 +402,7 @@ export const replyController = {
402402
const { note } = request.body.reply
403403
const { reply_uuid } = request.params
404404
const { data } = request.session
405-
const { __, activity, patientSession } = response.locals
405+
const { __, patientSession } = response.locals
406406

407407
// Clean up session data
408408
delete data.reply
@@ -412,15 +412,15 @@ export const replyController = {
412412

413413
request.flash('success', __(`reply.invalidate.success`, { reply }))
414414

415-
response.redirect(`${patientSession.uri}?activity=${activity || 'consent'}`)
415+
response.redirect(patientSession.uri)
416416
},
417417

418418
withdraw(request, response) {
419419
const { account } = request.app.locals
420420
const { refusalReason, refusalReasonOther, note } = request.body.reply
421421
const { reply_uuid } = request.params
422422
const { data } = request.session
423-
const { __, activity, patientSession, reply } = response.locals
423+
const { __, patientSession, reply } = response.locals
424424

425425
// Create a new reply
426426
const newReply = Reply.create(
@@ -464,6 +464,6 @@ export const replyController = {
464464

465465
request.flash('success', __(`reply.withdraw.success`, { reply }))
466466

467-
response.redirect(`${patientSession.uri}?activity=${activity || 'consent'}`)
467+
response.redirect(patientSession.uri)
468468
}
469469
}

app/views/patient-session/_note.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
{{ button({
2727
text: __("patientSession.notes.new.confirm"),
2828
attributes: {
29-
formaction: patientSession.uri + "/new/note?referrer=" + patientSession.uri + "/events?activity=" + activity
29+
formaction: patientSession.uri + "/new/note?referrer=" + patientSession.uri + "/events"
3030
}
3131
}) }}
3232
{% endcall %}

app/views/session/activity.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
headingSize: "s",
8686
headingLevel: 4,
8787
clickable: not showRegistration,
88-
href: patientSession.uri + "?activity=" + view
88+
href: patientSession.uri
8989
}) %}
9090
{{ summaryList({
9191
rows: summaryRows(patientSession.patient, {

0 commit comments

Comments
 (0)