What happens when I click the Stop button on the browser?

后端 未结 5 1984
生来不讨喜
生来不讨喜 2020-12-29 22:16

Let\'s say I click a button on a web page to initiate a submit request. Then I suddenly realize that some data I have provided is wrong and that if it gets submitted, then I

5条回答
  •  臣服心动
    2020-12-29 22:28

    Your submit in important scenarios should have two stages. Verify and submit. If the final submit goes though, you commit any tranactions. I cant think of any other way really to avoid that situation, other than allowing your user to undo his actions after a commit. for example The order example, after the order is done to allow your customers to change their mind and canel the order if it has not been shipped yet. Of course its extra code you need to write to suuport that.

提交回复
热议问题