SHARE
TWEET

Untitled

a guest Aug 20th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. validatePostSurveySchema(body) { const schema = Joi.object().keys({ title: Joi.string().required(), surveyContent: Joi.array().items([ { question: Joi.array().items([ { questionTitle: Joi.array().items(Joi.string()) } ]), options: Joi.array().items([ { option1: Joi.string().required(), option2: Joi.string().required(), option3: Joi.any(), option4: Joi.any() } ]) } ]) }); const { error } = Joi.validate(body, schema); if (error && error.details) { console.log(error); return { error }; } }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top