-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support soft-delete for tables from 'plugins' #5
Comments
How would you restore plugin's soft deleted items? |
I thought to call action restore no? If it is too difficult, we can avoid to add softDeletedAt to queries for non 'api:...' entity. |
Yeah, I think that is correct. |
If I'm not wrong this current issue is a feature request about adding support for core tables. The two issues even if related (core tables) are then different, because with different objectives. Fixing the bug could be first done in emergency since it breaks current installations (bugfix 0.9.4) and this present issue could be done later as a new minor/major version (0.10.0 or 1.0.0) depending of the feature being backward compatible with current implementation (ie. not supporting core tables by default, and enabling it with a config param). |
You look more widely at this issue. This is a more correct point of view I am sure. It was my first thought - I tried to find something in the config to add softDelete to the plugin's table, and then, when we found the issue with a query to the plugin:up_users table, I checked the config again :-) So it is a good place to manage enabled tables I think. May be enabled prefixes. |
The soft delete function is not applied to collection types that are created via a custom plugin. The problem stams from https://github.com/ChristopheCVB/strapi-plugin-soft-delete/blob/de490e7838c7270c2f44d02e3684670ad62b548c/utils/plugin.ts#L6C1-L8C3 is it possible to enable the soft delete for collection types of plugins as well? Or is this something that I can achieve by overriding it via extensions? In addition to the above, when you populate "deep" or populate data in general, the records are still populated even though they are soft deleted. This shouldn't happen in my opinion. Can you elaborate more on this and a possible solution to this? Please let me know. |
Is your feature request related to a problem? Please describe.
For all entities from api section softDelete works correctly.
But for @strapi/plugin-users-permissions
SofDelete didn't add the fields
_softDeletedAt: Attribute.DateTime & Attribute.Private;
_softDeletedById: Attribute.Integer & Attribute.Private;
_softDeletedByType: Attribute.String & Attribute.Private;
But for queries (update up_users) apply.
Describe the solution you'd like
in the strapi-plugin-soft-delete/utils/plugin.ts
replace by
The text was updated successfully, but these errors were encountered: