Skip to content

Commit

Permalink
Temporarily remove removeEmptyAnswersFromResponse to allow saving
Browse files Browse the repository at this point in the history
  • Loading branch information
fongsean committed Oct 24, 2024
1 parent 87d1d88 commit 374d115
Show file tree
Hide file tree
Showing 2 changed files with 6,147 additions and 1,634 deletions.
12 changes: 7 additions & 5 deletions apps/smart-forms-app/src/api/saveQr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import dayjs from 'dayjs';
import { qrToHTML } from '../features/preview/utils/preview.ts';
import { fetchQuestionnaireById } from './client.ts';
import { HEADERS } from './headers.ts';
import { removeEmptyAnswersFromResponse } from '@aehrc/smart-forms-renderer';

/**
* POST questionnaire to SMART Health IT when opening it to ensure response-saving can be performed
Expand Down Expand Up @@ -54,10 +53,13 @@ export async function saveProgress(
questionnaireResponse: QuestionnaireResponse,
saveStatus: 'in-progress' | 'completed'
) {
const responseToSave = removeEmptyAnswersFromResponse(
questionnaire,
structuredClone(questionnaireResponse)
);
// Temporarily comment out this line to avoid saving errors
// const responseToSave = removeEmptyAnswersFromResponse(
// questionnaire,
// structuredClone(questionnaireResponse)
// );

const responseToSave = structuredClone(questionnaireResponse);

responseToSave.status = saveStatus;

Expand Down
Loading

0 comments on commit 374d115

Please sign in to comment.