This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Destructuring cleans it up a bit | |
const { postCatalogues, updateCatalogues } = this.props; | |
const { catalogueName, activeStatusValidation } = formValidation; | |
// Bail early | |
if (catalogueName || activeStatusValidation) return; | |
// Model the data to avoid a switch - this makes more sense to me - seems more clear - you could even take this out of | |
// this method completely and include it as a property on the React component, as you may end up with more than add and edit, | |
// and perhaps it will be needed elsewhere? |