🐛 Fixed incorrect errors with Slides
This commit is contained in:
@@ -77,21 +77,23 @@ export const dataSchema = yup.object({
|
|||||||
if (Array.isArray(v)) {
|
if (Array.isArray(v)) {
|
||||||
try {
|
try {
|
||||||
if (typeof v[0].right === 'boolean') {
|
if (typeof v[0].right === 'boolean') {
|
||||||
// console.log('ABCDQuestionSchema');
|
console.log('ABCDQuestionSchema');
|
||||||
return ABCDQuestionSchema;
|
return ABCDQuestionSchema;
|
||||||
} else if (v[0].answer !== undefined) {
|
} else if (v[0].answer !== undefined) {
|
||||||
// console.log('VotingQuestionSchema');
|
console.log('VotingQuestionSchema');
|
||||||
return VotingQuestionSchema;
|
return VotingQuestionSchema;
|
||||||
} else {
|
} else {
|
||||||
// console.log('SlideQuestionSchema');
|
console.log('SlideQuestionSchema');
|
||||||
return yup.string().required();
|
return yup.string().required().nullable();
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
// console.log('SlideQuestionSchema');
|
console.log('SlideQuestionSchema');
|
||||||
return yup.string().required();
|
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 {
|
} else {
|
||||||
// console.log('RangeQuestionSchema');
|
console.log('RangeQuestionSchema');
|
||||||
return RangeQuestionSchema;
|
return RangeQuestionSchema;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user