Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add early return for responses page when a form hasn't been saved yet #3824

Merged
merged 2 commits into from
Jun 12, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,21 @@ export default async function Page({
overdueAfter: Number(await getAppSetting("nagwarePhaseEncouraged")),
};

// Handle the case where the user is not authenticated and the form ID is 0000
// In this case we know no responses will be returned, so we can skip the API call
if (isAuthenticated && id === "0000") {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should check for a UUID vs just 0000

return (
<Responses
initialForm={null}
nagwareResult={null}
lastEvaluatedKey={null}
overdueAfter={pageProps.overdueAfter}
responseDownloadLimit={pageProps.responseDownloadLimit}
vaultSubmissions={[]}
/>
);
}

try {
if (isAuthenticated) {
const initialForm = await fetchTemplate(id);
Expand Down
Loading