on 2023 Nov 15 2:35 PM
I have a Smarttable with a bunch of Smartfields in it in edit mode. When a user changes a value in a Smartfield and moves away from that field, as per standard practice I've implemented a validationSuccess event which updates the Draft in the backend (Patch call).
I also have a Save button at the bottom of the page where the user can click to save the Draft (ie. persist in the database and delete the Draft).
This all works well except when the user updates a field and without moving away clicks Save.
Sometimes, the update of the draft happens after the Save, which generates an error because the draft is already deleted.
How can I make sure that Save gets executed after the Patch of the draft? The two Promises are made in different functions in the controller, they don't have a view of whether another promise is waiting to be executed.
Would appreciate any hint on how standard draft-handling works in this scenario.
Thanks.
Request clarification before answering.
User | Count |
---|---|
76 | |
30 | |
10 | |
8 | |
8 | |
7 | |
7 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.