twentyhq / twenty

Building a modern alternative to Salesforce, powered by the community.
https://twenty.com
Other
23.67k stars 2.44k forks source link

Impossible to update soft-deleted record #7172

Closed FelixMalfait closed 2 days ago

FelixMalfait commented 2 months ago

In the UI it's possible to edit a soft-deleted record but the backend refuses it.

sid0-0 commented 2 months ago

I see that this is marked as a backend issue, but soft deleted records should not be editable, right? I believe the fix should be to block editing of soft deleted items from frontend.

FelixMalfait commented 2 months ago

@sid0-0 I was thinking it'd be best to leave it editable on fix it on the backend yes. Because for example when we introduce unicity constraints then it would allow the person to edit the email and restore the record even though there's a conflict.

But I'm not against a pure-frontend solution making it readonly, only if it's elegant code. I don't know that part of the codebase well enough to know if it's possible to do someting elegant across the app or if that implies refactoring the read-only implementation

pau-not-paul commented 4 weeks ago

I've implemented both solutions:

Merge the one that you think is better from a product perspective.

FelixMalfait commented 4 weeks ago

Haha great thanks @pau-not-paul

ehconitin commented 2 weeks ago

Any update on this issue? @pau-not-paul are you still working on the PR?