function validate(values){
  // console.log(values);
  const errors = {};
  if ( !values.title || values.title.length < 3 ) {
    errors.title = "Enter a title, which has more 3 characters!";
  }
  if(!values.categories){
    errors.categories = "Enter a categories"
  }
  if (!values.content) {
    errors.content = "Enter a content"
  }
  return errors;
}
/* Validate the data input if it's wrong
/*--------------------------------------------------------------*/
Validate the data input if it's wrong
Validate the data input if it ' s wrong
function validate(values){
  const errors = {};
  if ( !values.title || values.title.length < 3 ) {
    errors.title = "Enter a title, which has more 3 characters!";
  }
  if(!values.categories){
    errors.categories = "Enter a categories"
  }
  if (!values.content) {
    errors.content = "Enter a content"
  }
  return errors;
}
function validate ( values ) { const errors = { } ; if ( ! values . title || values . title . length < 3 ) { errors . title = "Enter a title, which has more 3 characters!" ; } if ( ! values . categories ) { errors . categories = "Enter a categories" } if ( ! values . content ) { errors . content = "Enter a content" } return errors ; }
Validate the data input if it's wrong
Validate the data input if it ' s wrong
// console.log(values);