-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontroller.js
35 lines (33 loc) · 925 Bytes
/
controller.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { welsh } from '~/src/server/data/cy/cy.js'
const accessibilityController = {
handler: (request, h) => {
const {
footer: { accessibility },
cookieBanner,
phaseBanner,
footerTxt,
multipleLocations
} = welsh
const { query } = request
const lang = 'cy'
if (query?.lang && query?.lang === 'en') {
return h.redirect('/accessibility')
}
return h.view('accessibility/index', {
userId: query?.userId,
utm_source: query?.utm_source,
pageTitle: accessibility.pageTitle,
title: accessibility.title,
heading: accessibility.heading,
headings: accessibility.headings,
paragraphs: accessibility.paragraphs,
displayBacklink: false,
phaseBanner,
footerTxt,
cookieBanner,
serviceName: multipleLocations.serviceName,
lang: query?.lang ?? lang
})
}
}
export { accessibilityController }