Skip to content

Commit 9e87d2b

Browse files
extends file upload validation to saving questionnaire
1 parent ce0b5ab commit 9e87d2b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

apps/backend/src/mutations/QuestionaryMutations.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,11 @@ export default class QuestionaryMutations {
244244
}
245245
const { value, ...parsedAnswerRest } = JSON.parse(answer.value);
246246
if (
247-
!isPartialSave &&
247+
(!isPartialSave ||
248+
(questionTemplateRelation.question.dataType ===
249+
DataType.FILE_UPLOAD &&
250+
value != null &&
251+
value.length > 0)) &&
248252
!(await isMatchingConstraints(questionTemplateRelation, value))
249253
) {
250254
return rejection(

0 commit comments

Comments
 (0)