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
1 change: 1 addition & 0 deletions src/features/form/components/FormDetailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ export const FormDetailPage = () => {
});

const answersArray = Object.entries(answers)
.filter(([questionId]) => sections.some(section => section.questions?.some(q => q.id === questionId)))
.filter(([questionId, value]) => value !== "" && !["UPLOAD_FILE", "OAUTH_CONNECT"].includes(questionTypeMap[questionId]))
.map(([questionId, value]) => {
Comment on lines 282 to 285
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

This new filter prevents sending answers whose questionType is missing from questionTypeMap (e.g., when a section becomes hidden). However, the submit path (handleSubmit builds answersArray separately later in this file) still constructs payloads from all answers without filtering out questionIds that aren’t in sections/questionTypeMap, so the same “missing type” error can still occur on submit. Consider extracting a shared helper to build the answers payload and reuse it in both auto-save and submit, or apply the same filtering logic in handleSubmit.

Copilot uses AI. Check for mistakes.
const questionType = questionTypeMap[questionId];
Expand Down