-
Notifications
You must be signed in to change notification settings - Fork 0
feat: ability to undo deletion #268
Description
it would be nice to be able to have an 'undo' button when the user deletes a resource in the admin panel. I thought about implementing this client side, by simply showing an "item has been deleted" modal with an undo button, which actually only sends the DELETE request after the time elapses (e.g. 10s), but that would mean that if the user 'deletes' something and refreshes the page immediately after, then it wouldn't actually get deleted, because no request will have been sent to the backend and the timer will have been lost due to component unmount.
I think the best way to implement this would add some kind of deletedAt field in the base controller, and DELETE would simply set the timestamp to the near future. if there is no PATCH sent that reverts it back to null, then it will actually get destroyed at the provided time.
what are your thoughts on this? maybe a different implementation?
Metadata
Metadata
Assignees
Labels
Type
Projects
Status