Skip to content
Snippets Groups Projects
Commit 9034cb2d authored by Stephanie Briere Americo's avatar Stephanie Briere Americo
Browse files

Merge branch 'issue/74' into 'develop'

Issue #74: Fix validation on backend

Closes #74

See merge request !73
parents 24809502 778dfc53
No related branches found
No related tags found
1 merge request!73Issue #74: Fix validation on backend
Pipeline #23147 passed
...@@ -166,6 +166,19 @@ export class ValidationHandler { ...@@ -166,6 +166,19 @@ export class ValidationHandler {
private static validateInput(input: Input, inputAnswers: InputAnswerDict): string { private static validateInput(input: Input, inputAnswers: InputAnswerDict): string {
const errors: string[] = []; const errors: string[] = [];
let inputMandatory: boolean = false;
for (const val of input.validation) {
if (val.type === ValidationType.MANDATORY) {
inputMandatory = true;
break;
}
}
if ((inputAnswers[input.id] === undefined || inputAnswers[input.id][0].value === "") && !(inputMandatory)) {
return;
}
for (const validation of input.validation) { for (const validation of input.validation) {
switch (validation.type) { switch (validation.type) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment