Skip to content

Commit f81c1dd

Browse files
committed
CCM-7465: update comment about forcing dynamically rendered page
1 parent 892e12a commit f81c1dd

File tree

1 file changed

+5
-4
lines changed
  • frontend/src/app/manage-templates

1 file changed

+5
-4
lines changed

frontend/src/app/manage-templates/page.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
import { NHSNotifyButton } from '@atoms/NHSNotifyButton/NHSNotifyButton';
22
import content from '@content/content';
33
import { ManageTemplates } from '@molecules/ManageTemplates/ManageTemplates';
4-
import { Template } from 'nhs-notify-web-template-management-utils';
54
import { getTemplates } from '@utils/form-actions';
65

7-
// Note: this page is forced to be server-side rendered
6+
// Note: force this page to be dynamically rendered
87
// This is because Next defaults this page as a static rendered page
9-
// which causes a build failure due to getTemplates attempting to get cookies
8+
// which causes a build failure due to getTemplates attempting to get a server-side session via cookies and failing
9+
// The other pages which do similar thing expect a templateId parameter
10+
// Which informs next it needs to be dynamically rendered
1011
export const dynamic = 'force-dynamic';
1112

1213
const manageTemplatesContent = content.pages.manageTemplates;
1314

1415
export default async function ManageTemplatesPage() {
15-
const availableTemplateList: Template[] | [] = await getTemplates();
16+
const availableTemplateList = await getTemplates();
1617

1718
return (
1819
<div className='nhsuk-grid-row' data-testid='page-content-wrapper'>

0 commit comments

Comments
 (0)