Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/server/plugins/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,11 @@ export default {
async handler(request, h) {
const { slug } = request.params
const form = await getFormMetadata(slug)
const definition = await getFormDefinition(form.id, FormStatus.Draft)
// It's most likely that we come into this route from a live version of the form
// so prefer that and fallback to draft if no live version (it is possible to have
// a live version and no draft version, so we cannot just default to 'draft').
const formStatus = form.live ? FormStatus.Live : FormStatus.Draft
const definition = await getFormDefinition(form.id, formStatus)

return h.view('help/privacy-notice', {
form,
Expand Down
Loading