Skip to content

Commit

Permalink
Add stopgap fix for #133; proper fix should come with the updated val…
Browse files Browse the repository at this point in the history
…idation.
  • Loading branch information
Jarno Rantanen committed Mar 29, 2020
1 parent 59b73a1 commit 98b1cfd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions frontend/embed/v1/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ function init() {
// unanswered fields are not included
const answers = $(this)
.serializeArray()
.map(x => (x.name === 'duration' ? { ...x, value: x.value.replace(/[^0-9]/g, '') } : x)) // clean any non-numeric characters from the "duration" field (https://github.com/futurice/symptomradar/issues/133)
.map(x => (x.value === '' ? { ...x, value: null } : x)) // convert empty strings (i.e. skipped questions) to nulls
.reduce((memo, next) => ({ ...memo, [next.name]: next.value }), {});
const meta = { participant_id: getParticipantId() };
Expand Down

0 comments on commit 98b1cfd

Please sign in to comment.