Hello Everyone :) I am Rohit and I am contributing to the commons-android app. The issue reference:- https://github.com/commons-app/apps-android-commons/issues/5728 and the solution PR:- https://github.com/commons-app/apps-android-commons/pull/5741
Before:- 1. Before the PR, the feature to edit the depicts was using wbeditentity API to edit the entity with a (clear=1) flag. 2. This was causing the whole identity data deletion and adding new data sent to the API with a data field containing updated depictions. 3. I tried removing that clear flag and it prevented the deletion of the whole data. However, it was causing depiction to add repeatedly the same without removing the old ones. 4. I know that it could be the scenario where only the updated depicts were sent to the API and it'll add the new depicts without causing repetition. But, what about if the user has removed a depiction?
My Solution:- 1. I used another API to delete the previous depiction first and then, used webeditentity API to update the new depictions. 2. But, this approach is causing two edit actions on the entity.
Please look at the problem and tell me if there is any way to achieve the desired functionality in a single edit.