I am attempting to use the “+” button on the UI to add a card, and the default ID generated for the newly added card is in the format “temp://1701253463530”. When I make a backend service call in the “add-card” event and receive the new ID (112) generated by the database, I update it in the newly added card. However, when I use the undo() method to trigger the “delete-card” event, the event log shows that a delete request was sent to the backend service, but the ID used is the default “temp://1701253463530”.
Is the ID update process incorrect?
How can this issue be resolved?
If to add a new card and then click on the undo button, you could see that the request is sent with the right, new ID from the server.
The new created cards are indeed stored under temporary local IDs. But during any server request an ID from the server is used. That is since a RestDataProvider stores an object of type { localId: serverId } until refreshing.
If there is an issue with our RestDataProvider, could you, please, write the steps for us to reproduce it? For example, in the snippet above.
Or, in case, you are using your own provider solution to work with the server, it’s up to you to decide how you would like to implement a way of IDs resolving.
Yes, using the RestDataProvider method now allows the backend access to work properly.
Previously, I was making custom backend calls within the add-card event, and there might have been issues with how I handled the results returned from the call, leading to problems.
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan