Skip to content

Commit

Permalink
fix: let them skip the essay
Browse files Browse the repository at this point in the history
  • Loading branch information
joelhooks committed Oct 28, 2024
1 parent e1cd0b1 commit 1c111d6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ export const dataTypescript2024: QuizResource = {
},
final_story: {
question: getFinalQuestion,
required: false,
type: 'essay',
},
},
Expand Down
6 changes: 4 additions & 2 deletions apps/total-typescript/src/offer/survey/survey-question.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,11 @@ const SurveyQuestion = React.forwardRef(function Question(
.label('Options')
.nullable()
: Yup.string().required('Pick an option.').nullable()
: Yup.string()
: props.currentQuestion.required
? Yup.string()
.nullable()
.required(`Can't stay empty. Mind to elaborate? :)`),
.required(`Can't stay empty. Please elaborate!`)
: Yup.string().nullable(),
}),
onSubmit: async (values) => {
console.log('formik on submit', values)
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export type QuestionResource = {
template?: string
shuffleChoices?: boolean
allowMultiple?: boolean
required?: boolean
code?: {
filename: string
active: boolean
Expand Down

0 comments on commit 1c111d6

Please sign in to comment.