🐛 Fixed incorrect errors with Slides

This commit is contained in:
Mawoka
2022-12-28 11:58:57 +01:00
parent d437d72005
commit 05779a56c1
+9 -7
View File
@@ -77,21 +77,23 @@ export const dataSchema = yup.object({
if (Array.isArray(v)) {
try {
if (typeof v[0].right === 'boolean') {
// console.log('ABCDQuestionSchema');
console.log('ABCDQuestionSchema');
return ABCDQuestionSchema;
} else if (v[0].answer !== undefined) {
// console.log('VotingQuestionSchema');
console.log('VotingQuestionSchema');
return VotingQuestionSchema;
} else {
// console.log('SlideQuestionSchema');
return yup.string().required();
console.log('SlideQuestionSchema');
return yup.string().required().nullable();
}
} catch {
// console.log('SlideQuestionSchema');
return yup.string().required();
console.log('SlideQuestionSchema');
return yup.string().required("The slide mustn't be empty").nullable();
}
} else if (typeof v === 'string' || v instanceof String) {
return yup.string().required("The slide mustn't be empty").nullable();
} else {
// console.log('RangeQuestionSchema');
console.log('RangeQuestionSchema');
return RangeQuestionSchema;
}
})