linkding
linkding copied to clipboard
Have the 'new' form load existing URL
The current behavior of the 'add' form simply overwriting existing bookmarks is pretty annoying. This is particularly true when trying to use using the bookmarklet.
In my opinion it would be ideal to completely merge the new+edit forms. If the 'new' form gets passed an existing URL load all the current details, instead of just allowing a blind overwrite with a warning.
This PR is my attempt at some of the changes you might need to do that.
This is an interesting idea, but it needs more work, and some more thought. I might get to this at some point.
A wrinkle I just thought about - how would this work if, say someone was submitting a URL through a mobile app/shortcut or an API?
how would this work if, say someone was submitting a URL through a mobile app/shortcut or an API?
Well it would depend on what we want to happen.
From the server side. I would assume any new URLS being added wouldn't need to change, and deletes URLs wouldn't need to change. Only updates to existing URLs would matter. In the case of duplicate URLS you could just accept the most recent change. Or if you avoid the possibility of accidentally replacing things, you could do something like only accept modification requests if they include the 'date_modified' value of the previous version in the post or something, so you only permitted to modify the record if the client proves it has retrieved the most recent version. If you use the second option your reject message could return the values for the URL in the database, and the new data, and let the client resolve the conflict and submit an updated request.
Closing in favor of https://github.com/sissbruecker/linkding/pull/402