function validate(values) {
  // return empty object if no errors
  const errors = {};

  if (!values.title ) {
    errors.title = "Enter a title for your post.";
  }

  if (!values.categories) {
    errors.categories = "Enter categories for your post.";
  }

  if (!values.content) {
    errors.content = "Enter content for your new post.";
  }

  // if errors is an empty object, there are no issues with validation
  // if errors has ANY properties, redux form assumes form is invalid
  return errors;
}
/*
  validation helper function
  - values is the values the user has entered into the form

  values -> {
    title: "title",
    categories: "category, category",
    content: "content string"
  }
*/
validation helper function
values is the values the user has entered into the form


validation helper function values is the values the user has entered into the form
function validate(values) {
  const errors = {};
  if (!values.title ) {
    errors.title = "Enter a title for your post.";
  }
  if (!values.categories) {
    errors.categories = "Enter categories for your post.";
  }
  if (!values.content) {
    errors.content = "Enter content for your new post.";
  }
  return errors;
}
function validate ( values ) { const errors = { } ; if ( ! values . title ) { errors . title = "Enter a title for your post." ; } if ( ! values . categories ) { errors . categories = "Enter categories for your post." ; } if ( ! values . content ) { errors . content = "Enter content for your new post." ; } return errors ; }
validation helper function
 values is the values the user has entered into the form
validation helper function values is the values the user has entered into the form
// return empty object if no errors // if errors is an empty object, there are no issues with validation // if errors has ANY properties, redux form assumes form is invalid