Closed JS-BC closed 2 months ago
@JS-BC let's make this "EntityTransactionResultType" instead and that way we can use this for both Save
and Delete
basically that would cover Create/Update/Delete scenarios, or all transactions.
@AN-BC This isnt needed now that we have BaseEntity.LatestResult
right?
@JS-BC yup - that's right, I'm closing this issue. Thanks.
Purpose: In the future, we want to add the ability to display error messages to a user if a save attempt fails (https://github.com/MemberJunction/MJ/issues/243). Currently, if a save attempt fails due to validation errors, an exception is thrown containing reasons why, i.e. Validation Error Messages. Rather than wrapping every save attempt client side in a try-catch block, it would be easier for us to get error messages and display them if the save attempt returns an object similar to the RunViewResult type that contains a Success, Result, and ErrorMessages properties.
The EntityTransactionResultType type could be defined as below:
Success: Boolean
ErrorMessages: String[]
ValidationErrorMessages: any[]
WarningMessages: String[]
Thoughts? @AN-BC