frontAnswerer/src/pages/ViewPublicationPage/tools/checkEmptyData.ts

17 lines
897 B
TypeScript
Raw Normal View History

import { QuizQuestionResult } from "@model/questionTypes/result"
export const checkEmptyData = ({ resultData }: { resultData: QuizQuestionResult }) => {
let check = true
if (
(resultData.title.length > 0 && resultData.title !== " ") ||
(resultData.description.length > 0 && resultData.description !== " ") ||
(resultData.content.back.length > 0 && resultData.content.back !== " ") ||
(resultData.content.originalBack.length > 0 && resultData.content.originalBack !== " ") ||
(resultData.content.innerName.length > 0 && resultData.content.innerName !== " ") ||
(resultData.content.text.length > 0 && resultData.content.text !== " ") ||
(resultData.content.video.length > 0 && resultData.content.video !== " ") ||
(resultData.content.hint.text.length > 0 && resultData.content.hint.text !== " " )
) check = false
return check
}